django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法
2017-09-14 22:29
761 查看
在python的开发中,遇到了这个错误:
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
解决方法如下:
在代码文件的最上方,添加如下代码:
注意,用的是python2.7.6版本
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
解决方法如下:
在代码文件的最上方,添加如下代码:
注意,用的是python2.7.6版本
import os,django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")# project_name 项目名称 django.setup()
相关文章推荐
- django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法
- django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法
- django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法
- django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法
- django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法
- django报错:django.core.exceptions.ImproperlyConfigured: 处理办法
- django报错:django.core.exceptions.ImproperlyConfigured: 处理办法
- Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured
- django报错:django.core.exceptions.ImproperlyConfigured: 处理办法
- django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.的解决办法
- django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.的解决办法
- django交互模式使用模板报:django.core.exceptions.ImproperlyConfigured
- Django中错误:django.core.exceptions.ImproperlyConfigured: ***DEFAULT_INDEX_TABLESPACE解决方
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module
- django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.报错终极解决办法
- django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATE_DEBUG, but settings are not解
- python基于Django框架编译报错“django.core.exceptions.ImproperlyConfigured”的解决办法?
- django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not
- 先后出现Requested setting DEFAULT_INDEX_TABLESPACE和No module named
- Not Found The requested URL /phpMyAdmin/index.php was not found on this server.解决办法