django.template.exceptions.TemplateDoesNotExist: index.html

django.template.exceptions.TemplateDoesNotExist: index.html

在网上查了下,setting中 TEMPLATES 的 'DIRS' 需要添加os.path.join(BASE_DIR, 'templates')

TEMPLATES = [
    {
        ...
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        ...
    },
]

  

原文地址:https://www.cnblogs.com/hanzg/p/12037712.html