首页 > 其他 > 详细

第十八节 templates模板查找路径

时间:2020-03-08 19:06:12      阅读:81      评论:0      收藏:0      [点我收藏+]

技术分享图片

setting.py 中配置

 1 import sys
 2 
 3 TEMPLATES = [
 4     {
 5         ‘BACKEND‘: ‘django.template.backends.django.DjangoTemplates‘,
 6         ‘DIRS‘: [os.path.join(BASE_DIR, ‘templates‘)],  # 拼接路径
 7         ‘APP_DIRS‘: True,
 8         ‘OPTIONS‘: {
 9             ‘context_processors‘: [
10                 ‘django.template.context_processors.debug‘,
11                 ‘django.template.context_processors.request‘,
12                 ‘django.contrib.auth.context_processors.auth‘,
13                 ‘django.contrib.messages.context_processors.messages‘,
14 
15             ],
16         },
17     },
18 ]

 

第十八节 templates模板查找路径

原文:https://www.cnblogs.com/kogmaw/p/12443967.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!