关于Django报错django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configure

2023-05-16,,

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

解决方法:

添加环境变量:

DJANGO_SETTINGS_MODULE=projecname.settings #projectname是你的项目名字

其他的自己百度,还有许多其他方法。

关于Django报错django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configure的相关教程结束。

《关于Django报错django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configure.doc》

下载本文的Word格式文档,以方便收藏与打印。