Comments not working in jinja2

Basically, jinja2 is only concerned with finding an evaluating its own blocks, not the structure of the HTML. If you want to exclude a section of your template entirely, you can use jinja2’s comment syntax:

{# This is a comment now.
    <div class="control-group">
       ...
    </div>
#}

Leave a Comment