好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

django.core.exceptions.ImproperlyConfigured: Reque

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的详细内容...

  阅读:33次

上一篇: python2.x与3.x 区别

下一篇:JWT(JSON Web)使用