当前位置: 首页 > 工具软件 > TARE > 使用案例 >

Django报错:Apps aren't loaded yet.

柴琨
2023-12-01

raise AppRegistryNotReady("Apps aren't loaded yet.")

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

解决办法:

views.py开头添加:

import os,django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")
django.setup()
 
 类似资料: