Django 1.8到1.9升级:django.core.exceptions.AppRegistryNotReady:尚未加载应用程序

时间:2015-12-02 10:16:36

标签: python django django-1.8 django-1.9

我有一个目前正在研究Django 1.8的项目。自刚刚发布1.9以来,我想我会通过pip install django==1.9更新。但是,在运行python manage.py test -v 3时,我收到此错误:

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/core/management/__init__.py", line 324, in execute
    django.setup()
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/reversion/__init__.py", line 11, in <module>
    from reversion.revisions import default_revision_manager, revision_context_manager, VersionAdapter
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/reversion/revisions.py", line 18, in <module>
    from django.contrib.contenttypes.models import ContentType
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 159, in <module>
    class ContentType(models.Model):
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/db/models/base.py", line 94, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/user/Envs/intranet/lib/python2.7/site-packages/django/apps/registry.py", line 239, in get_containing_app_config
    self.check_apps_ready()
  File "/home/user/Envs/intranet/lib/python2.7/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.

我知道INSTALLED_APPS已从元组更改为列表。

我可能错过的任何其他内容?

1 个答案:

答案 0 :(得分:8)

尝试升级django-reversion,今天发布了1.10 version

  

Django 1.9兼容性(@etianen)。

来自讨论组https://groups.google.com/forum/#!topic/django-reversion/3AQipnbKaUI的消息

  

最新版本的django-reversion(1.10.0)现已上市   GitHub和PyPi。此版本增加了与Django 1.9的兼容性。

     

重要提示:此版本包含重大更改。请查看   安装前在GitHub上发布说明。

     

不幸的是,为了支持,这些重大变化是必需的   Django 1.9。令人高兴的是,您需要做的就是修改您的回归   进口地点,一切都将继续有效。

     

快乐的编码!