当我使用runserver时,它会发出以下警告消息:
(1_8.W001)Django 1.8中不推荐使用独立的TEMPLATE_*设置,TEMPLATES字典优先.您必须将以下设置的值放入默认的TEMPLATES dict:TEMPLATE_DEBUG.
Django文档:
"TEMPLATE_DEBUG从版本1.8开始不推荐使用:在DjangoTemplates后端的OPTIONS中设置'debug'选项."
这是我的settings.py与我徒劳的尝试修复它:
DEBUG = True
TEMPLATE_DEBUG = DEBUG
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'myapp/templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
'debug': DEBUG,
'DEBUG': DEBUG,
'TEMPLATE_DEBUG': DEBUG
},
}, ]
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?