标签:var 解决办法 except pac perl red not tde The
在python的开发中,遇到了这个错误:
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: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法(转)
标签:var 解决办法 except pac perl red not tde The
原文地址:https://www.cnblogs.com/szhangli/p/9998267.html