django.core.exceptions.ImproperlyConfigured 异常

使用 PyCharm 运行按钮启动 Django 项目报如下异常:django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

解决方案:
run configuration 里面按下图设置 django 项目的 settings 模块
django.core.exceptions.ImproperlyConfigured 异常_第1张图片

你可能感兴趣的:(Django,Web,后端)