今天在写大作业的时候修改html文件时报错 Invalid block tag on line 17: 'endfor', expected 'elif', 'else' or 'endif'。
上网查找之后提示可能是格式错误,在查找之后发现并无格式错误。
之后查看之后发现在if后缺少一个{% endif %}
<p class="card-text">{{author.date_of_birth}} - {% if author.date_of_death %}{{author.date_of_death}}{% endif %})</p>