报错信息:django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
解决办法:
在文件加入以下代码:
import os,djangoos.environ.setdefault("DJANGO_SETTINGS_MODULE", "HelloWorld.settings")# project_name 项目名称django.setup() 具体问题我也不是很清楚
原文地址:https://www.cnblogs.com/lystbc/p/9332772.html
时间: 2024-11-08 05:44:44