django.core.exceptions.ImproperlyConfigured:请求设置INSTALLED_APPS

lmyy7pcs  于 2022-12-24  发布在  Go
关注(0)|答案(1)|浏览(364)

我收到以下错误:

django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

我不知道去哪里找

rqqzpn5f

rqqzpn5f1#

确保您没有删除settings.py中的INSTALLED_APPS列表。类似于:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # add new apps here and don't delete the ones above
]
``

相关问题