报错:
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"})