![](/img/trans.png)
[英]Django template: Invalid block tag: 'endif', expected 'empty' or 'endfor'
[英]Django Template syntax error (Invalid block Tag)
我想在我的网站上打开我的预订表格页面,但我收到了这个错误:
TemplateSyntaxError at /form.html/
Invalid block tag on line 61: 'end', expected 'empty' or 'endfor'. Did you forget to register or
load this tag?
这是我的代码:
{% if messages %}
{% for message in messages %}
<h2 style="color: green">{{message}}</h2>
{% end for %} //the line I got the error
{% end if %}
结尾和关键字之间不应有空格。
{% if messages %}
{% for message in messages %}
<h2 style="color: green">{{message}}</h2>
{% endfor %}
{% endif %}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.