我从此代码中得到意外结果
foo.html:
{{ include "bar.html" with x="xx.html" y="y1"}}
{{ include "bar.html" with x="yy.html" y="y2"}}
{{ include "bar.html" y="y3"}}
bar.html:
{% if x %}
y
x
{{include x}}
{% else %}
pass
{% endif %}
如果我将bar.html代码放在modal-body
之外,则代码可以正常工作但是如果modal-body
中的代码给出了怪异的结果
y1
xx
<render xx.html>
y2
xx
<render xx.html> <--- why this render xx and not yy
y3
xx
<render xx.html> <--- still printing x and rendering xx.html
django:3.0.3python:3.6.9