django 模板语言的注释操作

Django在HTML里面书写的模板语言不能使用这种方法注释,这样注释实际依然有效

<!--{% if text %}-->

第一种使用模板标签{% comment %}注释,这是块注释

{% comment %}
    {% if text %}
        xxxxxxx
        xxxxxx
{% endcomment %}

第二种是使用#号注释,这是单行单行的注释

{#% if text %#}
{#% endif %#}

 

posted @ 2018-12-21 11:32  一个大柚子  阅读(3049)  评论(0编辑  收藏  举报