我想用一行来评论这一点
{% if something.property %}
<table>
<tr>...
{% # this is a comment %}
{% if something.property %}
<table>
<tr>...
发布于 2009-04-06 00:13:17
正如Miles回答的那样,{% comment %}...{% endcomment %}
用于多行注释,但您也可以注释掉同一行的文本,如下所示:
{# some text #}
发布于 2009-04-06 00:13:18
使用{# #}
表示法,如下所示:
{# Everything you see here is a comment. It won't show up in the HTML output. #}
发布于 2019-04-18 15:30:29
django模板中的多行注释的用法如下:对于.html等。
{% comment %} All inside this tags are treated as comment {% endcomment %}
https://stackoverflow.com/questions/719915
复制相似问题