项目文件夹Django中的模板doesnotexist

2024-07-07 08:13:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我的应用程序Django(Django 1.8)的结构如下所示。 当我尝试在app1中使用template或者在应用程序的base.html中使用app2扩展base.html时,我会得到这个错误。

TemplateDoesNotExist at /
base.html
Error during template rendering

In template /myProject/project_folder/app1/templates/app1/base.html, error at line 1
{% extends "base.html" %}

这是我的项目结构

/projekt_folder
    template
        base.html
    /app1
        /template
            base.html <-- {% extends "base.html" %}
    /app2
        /template
            base.html <-- {% extends "base.html" %}

Tags: django应用程序basehtml错误templateerrorfolder