How to put comments in Django templates

Alex. S. picture Alex. S. · Apr 6, 2009 · Viewed 100.1k times · Source

I would like to comment this with a line

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



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

Answer

Van Gale picture Van Gale · Apr 6, 2009

As answer by Miles, {% comment %}...{% endcomment %} is used for multi-line comments, but you can also comment out text on the same line like this:

{# some text #}