一個使用python-社會權威性的Django makemigrations導致權限被拒絕錯誤
python manage.py makemigrations
我得到一個令人吃驚的權限將蟒蛇社會AUTH我安裝的應用程序,即
INSTALLED_APPS = (
...
'social.apps.django_app.default',
...
)
,然後嘗試後錯誤
Migrations for 'default':
0002_auto_20150217_2053.py:
- Alter field user on usersocialauth
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management /__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 124, in handle
self.write_migration_files(changes)
File "/usr/lib/python2.7/site-packages/django/core/management/commands /makemigrations.py", line 153, in write_migration_files
with open(writer.path, "wb") as fh:
IOError: [Errno 13] Permission denied: u'/usr/lib/python2.7/site-packages/social/apps/django_app/default/migrations/0002_auto_20150217_2053.py'
它是有道理的,我不能寫入系統寬包安裝導演IES。
有一些明顯的解決方法,比如更改site-packages/social目錄的權限。然而,這是做這件事的唯一方式,還是我錯過了什麼?
你爲什麼試圖在系統包中進行應用程序的遷移?如果你想貢獻,你應該把這個包的代碼複製到單獨的django項目中並在那裏進行遷移。 – GwynBleidD 2015-02-17 21:30:37
好點。但我只是按照這裏的建議https://python-social-auth.readthedocs.org/en/latest/configuration/django.html – mjandrews 2015-02-17 21:43:11
我認爲這是Python-social-auth的文檔中的錯誤。軟件包應提供準備使用的遷移。 – GwynBleidD 2015-02-18 09:13:54