请问大家有遇到过这种问题么, stackoverflow 的 import django ; django.setup()解决办法不可用。 如果在服务器上不适用 xadmin ,就可以正常启动
具体错误
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 338, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/
__init__.py", line 312, in execute
django.setup()
File "/usr/lib/python2.7/site-packages/django/
__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python2.7/site-packages/django/apps/
registry.py", line 108, in populate
app_config.import_models(all_models)
File "/usr/lib/python2.7/site-packages/django/apps/
config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python2.7/importlib/
__init__.py", line 37, in import_module
__import__(name)
File "/usr/lib/python2.7/site-packages/xadmin/
models.py", line 19, in <module>
AUTH_USER_MODEL = django.contrib.auth.get_user_model()
File "/usr/lib/python2.7/site-packages/django/contrib/auth/
__init__.py", line 150, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL)
File "/usr/lib/python2.7/site-packages/django/apps/
registry.py", line 199, in get_model
self.check_models_ready()
File "/usr/lib/python2.7/site-packages/django/apps/
registry.py", line 131, in check_models_ready
raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/341666
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.