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

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

问题描述

从 1.8 升级到 django 1.9 时出现此错误.我查看了类似问题的答案,但我认为这不是任何 3rd 方软件包或应用的问题.

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'.

推荐答案

我在我的一个模型 __init__.py 文件中编写了一个自定义函数.它导致了错误.当我从 __init__.py 移动这个函数时,它起作用了.

I'd a custom function written on one of my models __init__.py file. It was causing the error. When I moved this function from __init__.py it worked.

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

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