Django升级到1.9错误“AppRegistryNotReady:Apps尚未加载”。 [英] Django upgrading to 1.9 error "AppRegistryNotReady: Apps aren't loaded yet."

查看:786
本文介绍了Django升级到1.9错误“AppRegistryNotReady:Apps尚未加载”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当从1.8升级到django 1.9时,我收到了这个错误。我检查了类似问题的答案,但我并不认为这是任何第三方软件包或应用程序的问题。

When upgraded to django 1.9 from 1.8 I got this error. I checked answers for similar questions, but I didn't think this is an issue with any 3rd party packages or apps.

Traceback (most recent call last):
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv)
File "/home/kishore/.virtualenvs/andone/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/home/kishore/.virtualenvs/andone/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/kishore/.virtualenvs/andone/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 176, in fetch_command
commands = get_commands()
File "/home/kishore/.virtualenvs/andone/local/lib/python2.7/site-packages/django/utils/lru_cache.py", line 100, in wrapper
result = user_function(*args, **kwds)
File "/home/kishore/.virtualenvs/andone/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 71, in get_commands
for app_config in reversed(list(apps.get_app_configs())):
File "/home/kishore/.virtualenvs/andone/local/lib/python2.7/site-packages/django/apps/registry.py", line 137, in get_app_configs
self.check_apps_ready()
File "/home/kishore/.virtualenvs/andone/local/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.

我修改了'django.contrib.auth'的已安装应用程序。

I'd modified the Installed apps for 'django.contrib.auth'.

推荐答案

尝试将此行添加到设置文件的顶部:

Try to add this lines to the top of your settings file:

import django
django.setup()

如果不会帮助您尝试从您已安装的应用程序列表中逐个删除第三方应用程序。

And if this will not help you try to remove third-party applications from your installed apps list one-by-one.

这篇关于Django升级到1.9错误“AppRegistryNotReady:Apps尚未加载”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆