TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, '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',
],
},
},
]
'DIRS': [os.path.join(BASE_DIR, 'templates')],
本文详细介绍了Django框架中模板系统的配置方法,包括如何设置模板目录、启用应用目录搜索以及定义上下文处理器等内容。对于想要深入了解Django模板机制的开发者来说非常实用。
1492

被折叠的 条评论
为什么被折叠?



