我正在将一个大项目从Django 1.8迁移到Django 1.9,当我尝试运行该项目时,我得到一个AppRegistryNotReady异常。这个问题的追溯似乎完全没有用。
Traceback (most recent call last):
File "/opt/project/myproject/manage.py", line 16, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 176, in fetch_command
commands = get_commands()
File "/usr/local/lib/python2.7/dist-packages/django/utils/lru_cache.py", line 100, in wrapper
result = user_function(*args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 71, in get_commands
for app_config in reversed(list(apps.get_app_configs())):
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 137, in get_app_configs
self.check_apps_ready()
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
由于回溯中的任何内容都不是我项目的代码,我该如何追踪此问题的来源呢?
答案 0 :(得分:0)
由于当INSTALLED_APPS
中的应用未正确安装时可能会出现此错误,请尝试注释掉应用以尝试查找导致问题的应用。