我想在我的网站上打开我的预订表单页面,但我出现了这个错误:
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 %}