gpt4 book ai didi

python - Django 升级到 1.9 错误 "AppRegistryNotReady: Apps aren' t 已加载。”

转载 作者:IT老高 更新时间:2023-10-28 21:39:22 24 4
gpt4 key购买 nike

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

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”的已安装应用程序。

最佳答案

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

import django
django.setup()

如果这对您没有帮助,请尝试从已安装的应用列表中逐一删除第三方应用。

关于python - Django 升级到 1.9 错误 "AppRegistryNotReady: Apps aren' t 已加载。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34114427/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com