美文网首页Pandas
django.core.exceptions.Improperl

django.core.exceptions.Improperl

作者: LeslieLiang | 来源:发表于2020-11-09 10:08 被阅读0次

    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.Improperl

        本文链接:https://www.haomeiwen.com/subject/diqlbktx.html