hanzg

django.template.exceptions.TemplateDoesNotExist: index.html

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

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

  

分类:

技术点:

相关文章: