码迷,mamicode.com
首页 > Web开发 > 详细

Django 找不到模版报错" django.template.exceptions.TemplateDoesNotExist: index.html"

时间:2018-12-09 14:17:40      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:exist   templates   16px   ext   sso   set   col   djang   process   

解决办法:在setting.py的TEMPLATES‘DIRS‘[]加入模版路径

 
TEMPLATES = [
    {
        BACKEND: django.template.backends.django.DjangoTemplates,
        DIRS: [os.path.join(BASE_DIR, templates)],
        #os.path.join(BASE_DIR, ‘templates‘)没了这句,
        # 会显示django.template.exceptions.TemplateDoesNotExist: index.html
        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,
            ],
        },
    },
]

 

Django 找不到模版报错" django.template.exceptions.TemplateDoesNotExist: index.html"

标签:exist   templates   16px   ext   sso   set   col   djang   process   

原文地址:https://www.cnblogs.com/pychina/p/10090673.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!