【发布时间】:2022-01-20 18:47:18
【问题描述】:
我正在尝试在我的 base.html 中包含一个文件 基地内部,客栈base.html
{% block content %}
{% include "something.html" %}
{% endblock %}
但是包含的文件中没有显示任何内容,我试图在 something.html 中设置块
{% block content %}
something something inside the something.html
{% endblock %}
我也试过不使用积木,但没有。
【问题讨论】:
-
您忘记了
{% include "something.html" %}标记中的右双引号 (")。 -
更新了,我只是在问题中忘记了,不在模板中
-
您的“父”模板是否定义了
content块? -
所有其他扩展基础的模板都有块内容是
-
并且你没有在
something.html中使用{% block ... %}s等。
标签: python django django-templates