解决django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings...

在开发Django项目时,调整了django文件目录结构

同时配置完自己的配置文件路径后

在终端执行python manage.py runserver命令启动django项目时,报以下错误:

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

解决办法

依次点击File -> Settings -> Build, Execution,Deployment -> Console -> Django Console

然后新增环境变量:

DJANGO_SETTINGS_MODULE = luffy项目.settings.develop

 

 同理

若点击pycharm中的绿色小三角启动django项目也报错

 
 
posted @ 2022-10-22 23:19  weer-wmq  阅读(467)  评论(0编辑  收藏  举报