[英]'TemplateDoesNotExist at /' Error in django?
服務器工作正常,但是在為該“ home.html”文件使用擴展文件時,無法鏈接模板:
在“ home.html”中:
{%擴展“ /template1/personal/header.html”%}在加載localhost時:Django嘗試按以下順序加載這些模板:
`使用引擎django:
1)檢查settings.py中TEMPLATE_DIRS變量中的內容。 這是Django在每個應用程序中查找的文件夾,以查找您的模板。
2)嘗試刪除斜杠:
{% extends 'template1/personal/header.html' %}
3)如果template1在TEMPLATE_DIRS中,那么'app / template.html'就足夠了
{% extends 'personal/header.html' %}
繼續閱讀:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.