小编典典

如何在 Django 模板中添加注释

all

我想用一行来评论这个

{% if something.property %}
    <table>
        <tr>...



{% # this is a comment %}
{% if something.property %}
    <table>
        <tr>...

阅读 136

收藏
2022-05-20

共1个答案

小编典典

作为 Miles 的回答,{% comment %}...{% endcomment %}用于多行注释,但您也可以像这样在同一行注释掉文本:

{# some text #}
2022-05-20