首页 > 编程语言 >解决django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings...

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

时间:2022-10-22 23:36:02浏览次数:57  
标签:core LOGGING settings django setting Requested

在开发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项目也报错

   

标签:core,LOGGING,settings,django,setting,Requested
From: https://www.cnblogs.com/weer/p/16817597.html

相关文章