Django You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.confi

1、今天在新建Django 项目时,报错,内容如下。

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

解决办法:

设置pycharm

配置你的项目名称+ setting

文件解决

猜你喜欢

转载自blog.csdn.net/u012798683/article/details/107016863