首页 > 其他 > 详细

django.core.exceptions.ImproperlyConfigured: Reque

时间:2020-11-10 10:12:30      阅读:31      评论:0      收藏:0      [点我收藏+]

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,django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")# project_name 项目名称
django.setup()

django.core.exceptions.ImproperlyConfigured: Reque

原文:https://blog.51cto.com/14284354/2548050

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!