zoukankan      html  css  js  c++  java
  • django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured.

    在views调试主函数
    会出现

    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.

    在views.py最上部,添加上:

    import os,django
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings") # project_name 项目名称
    django.setup()
  • 相关阅读:
    Alpha、Beta、RC、GA版本的区别
    convertView
    Layouts
    Styles and Themes
    Android Studio
    Promise.race
    Base64
    NodeJS搭建HTTPS服务器
    CoreSeek
    Ping of Death
  • 原文地址:https://www.cnblogs.com/yuzhen0228/p/10830760.html
Copyright © 2011-2022 走看看