I would like to comment this with a line
{% if something.property %}
<table>
<tr>...
{% # this is a comment %}
{% if something.property %}
<table>
<tr>...
Comment tags are documented at https://docs.djangoproject.com/en/stable/ref/templates/builtins/#std:templatetag-comment
{% comment %} this is a comment {% endcomment %}
Single line comments are documented at https://docs.djangoproject.com/en/stable/topics/templates/#comments
{# this won't be rendered #}
In contrast to traditional html comments like this:
<!-- not so secret secrets -->
Django template comments are not rendered in the final html. So you can feel free to stuff implementation details in there like so:
Multi-line:
{% comment %}
The other half of the flexbox is defined
in a different file `sidebar.html`
as <div id="sidebar-main">.
{% endcomment %}
Single line:
{# jquery latest #}
{#
beware, this won't be commented out...
actually renders as regular body text on the page
#}
I find single line comments especially helpful as placeholders for views that have not been created yet <a href="{% url 'view_name' %}"
.