码迷,mamicode.com
首页 > 其他好文 > 详细

django中执行py报错Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured

时间:2018-05-10 15:38:23      阅读:1819      评论:0      收藏:0      [点我收藏+]

标签:tab   figure   .config   sdn   cal   default   you   exception   for   

https://blog.csdn.net/heybob/article/details/49684261

django代码下面直接run的时候报错:

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.

查了下,解决办法是在模块前面添加:

import os
os.environ.update({"DJANGO_SETTINGS_MODULE": "config.settings"})

django中执行py报错Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured

标签:tab   figure   .config   sdn   cal   default   you   exception   for   

原文地址:https://www.cnblogs.com/jijizhazha/p/9019425.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!