报错:

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.

 

大概有两种情况:

(原因不清楚,只有方法)

1:

比如项目是project1:

在开头导入wsgi

from project1.wsgi import *

 2:

就是网上很多的什么环境变量问题:

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

 

相关文章:

  • 2021-09-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-04-05
  • 2021-08-19
猜你喜欢
  • 2021-06-07
  • 2022-12-23
  • 2021-10-13
  • 2022-02-15
  • 2021-12-30
  • 2021-12-09
  • 2022-12-23
相关资源
相似解决方案