django TEMPLATES

时间:2023-03-09 07:40:19
django TEMPLATES
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. 
You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
     #主要看下面这行。需要将templates添加至dirs中。应该是某个版本改了这个东西,不再是TEMPLATES_DIRS了。
'DIRS': [os.path.join(os.path.dirname(__file__),'templates').replace('\\','/'),],
'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',
],
},
},
]