I'm curious, i have the following code {% code_goes_here %}
, how do I comment it out in the html file?
Django templates has {# ... #}
as comments. NOTE: These comments are not multi-line.
There are multiple ways to comment in templates as other people have mentioned in their answers, so I thought I'll quickly summarize them below:
As brc mentioned above, you could use HTML comments <!-- -->
but the comment would show if the user views the source of the page.
For single line comments in templates, use:
{# ... #}
For multi-line comments in templates, use:
{% comment %}
{% code_goes_here %}
{% endcomment %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With