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

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

Django You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.confi_第1张图片

 

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

Django You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.confi_第2张图片

配置你的项目名称+ setting

文件解决

你可能感兴趣的:(Django,django,python,linux)