Requested setting LOGGING_CONFIG, but settings are not configured
测试运行python文件异常现象 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. 解决方法: from django.conf import settings settings.configure(DEBUG=True) 测试运行服务出现WARNINGS:提示 1:URL namespace 'djdt' isn't unique. You may not be able to reverse all URLs in this namespace 在对应的URL.py文件中添加 app_name = ''