之前的(<1.8)版本add template 是在settings 中的一个叫做TEMPLATE_DIRS
现在django 在settings 中提供了TEMPLATES项,这个项defaut 是
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'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',
],
},
}
现在我们要将我们要的templates 路径加进DIRS就好,其他一个一些具体配置可以refer to:
https://docs.djangoproject.com/en/1.10/ref/templates/upgrading/