针对Error: You must either define the environment variable DJANGO_SETTINGS_MODULE ...问题的解决
来源:互联网 发布:app开发团队编程人数 编辑:程序博客网 时间:2024/06/01 08:34
针对Error: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings问题的解决
使用intelliJ Idea开发django项目,启动 manage.py 测试时,会出现如上所示问题。
根据提示,有两种解决方法:
define the environment variable DJANGO_SETTINGS_MODULE
在manage.py文件中添加
import osos.environ.setdefault("DJANGO_SETTINGS_MODULE", "你的project.settings")
call settings.configure() before accessing settings
manage.py文件中添加
from django.conf import settingssettings.configure(DEBUG=True)
添加完代码后,检查是否修改项目的project structure设置
Project structure->Facets->Django->
django project root: ##你的django项目路径settings: ##你的settings.py文件路径manage.py script: ##manage.pyEnvironment variables: ##添写需要的环境变量
0 0
- 针对Error: You must either define the environment variable DJANGO_SETTINGS_MODULE ...问题的解决
- 解决tomcat报的错“The JRE_HOME environment variable .......”问题
- No JDK found. Please validate either IDEA_JDK, JDK_HOME or JAVA_HOME environment variable……问题的解决
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 完美解决(tomcat error)
- django模板报错Requested setting TEMPLATE_DEBUG, but settings are not configured. You must either define
- Meteor Error: Must pass options.rootUrl or set ROOT_URL in the server environment解决
- Define environment variable in LINUX
- 解决安装VC6.0的问题—you must first run the installation wizard before running the setup
- 解决The environment variable JAVA_HOME does not point to a valid JVM installation 问题
- 解决IDE下The TOMCAT_7_HOME environment variable is not defined correctly问题
- You must configure either the server or JDBC driver (via the serverTimezone configuration property)
- You must restart adb and Eclipse问题的解决
- You must restart adb and Eclipse问题的解决
- Configure the environment variable
- The CATALINA_HOME environment variable
- The http_proxy Environment Variable
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- FontMetrics与TextView.textSize的关系
- JS学习第七篇;自定义拖拽上传按钮
- 使用mybatis时Mapper.xml文件中如何判断多个参数不为空和null
- JMS&MQ,从入门到精通(三)
- VSS添加用户
- 针对Error: You must either define the environment variable DJANGO_SETTINGS_MODULE ...问题的解决
- 学习HBase与HDFS的基本编程使用
- MVC模式 Ajax 报错Error(parsererror)
- Prometheus 实战于源码分析之API与联邦
- JavaWeb 入门级项目实战 -- 文章发布系统 (第八节)
- 全局变量、局部变量、静态全局变量、静态局部变量的区别——百度笔试一个知识点
- 并发和并行的区别
- Spring Security 自定义资源访问权限过滤器Fliter ,参考FilterSecurityInteceptor
- 有了这些java面试题目和答案,你还有什么过不去的梗