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"})
原文地址:https://www.cnblogs.com/jijizhazha/p/9019425.html
时间: 2024-11-02 15:59:57