我的应用程序在我配置PostgreSQL的本地服务器上工作得非常好,我也在远程使用PostgreSQL。
我的一些应用程序使用外键关系到用户模型,我使用了其他几个答案中建议的AUTH_USER_MODEL
设置。但它并没有解决问题。
我尝试删除迁移并在Database instant上删除公共架构并重新部署,但仍未成功。
这是日志
Traceback (most recent call last):
File "/opt/python/run/venv/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 25, in handle
call_command("migrate", **options)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
return command.execute(*args, **defaults)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 179, in handle
created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 317, in sync_apps
cursor.execute(statement)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
是否在1.8中运行syndb,因为它被弃用了?
我正在使用django 1.8和django-social-auth。
谢谢!
答案 0 :(得分:0)
我通过单独运行解决了这个问题
django-admin.py migrate auth
显然,简单地运行django-admin.py migrate
并不会迁移&#34; auth&#34; app默认情况下。任何想法为什么会发生这种情况?