django报错之django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODUL

报错代码:

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.

看了半天,我还以为真的什么环境变量没有配置好。检查了n久的代码,没有发现错误,只好百度了。然后这结果就有点哭笑不得了。

算了,直接上图吧。直接点

我的个天,启动的位置不对,开始启动的是urls能不报错嘛。下次一定要注意。

原文地址:https://www.cnblogs.com/accolade/p/10864611.html