Django AppRegistryNotReady错误

时间:2015-10-29 12:24:50

标签: python django django-1.9

将我的项目从1.8.5迁移到1.9b1会导致下一次追溯

Traceback (most recent call last):
  File "/Users/.../manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/.../env3/lib/python3.5/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/Users/.../env3/lib/python3.5/site-packages/django/core/management/__init__.py", line 342, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/.../env3/lib/python3.5/site-packages/django/core/management/__init__.py", line 176, in fetch_command
    commands = get_commands()
  File "/Users/.../env3/lib/python3.5/site-packages/django/core/management/__init__.py", line 71, in get_commands
    for app_config in reversed(list(apps.get_app_configs())):
  File "/Users/.../env3/lib/python3.5/site-packages/django/apps/registry.py", line 137, in get_app_configs
    self.check_apps_ready()
  File "/Users/.../env3/lib/python3.5/site-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.

Process finished with exit code 1

我的manage.py很简单:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.base")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)

我查看了Django 1.9更新指南,但它没有提供有关App loading的任何信息。

1 个答案:

答案 0 :(得分:1)

当找不到设置文件时,我通常会看到类似的错误消息堆栈。因此,在这种情况下,您的settings\base.py文件无法找到或缺少django 1.9所需的某些设置。

由于这是一个迁移,我假设你正在使用virtualenv,并且已经将django 1.9b1安装到新环境并在那里运行应用程序。

如果是这种情况,那么尝试创建一个新的“虚拟”项目,看看干净的django 1.9设置文件是什么样的。