verbatim Tag

Coding

Argument(s): blockname

Documentation

Template rendering is turned off between open {% verbatim blockname %} and closing {% endverbatim blockname %}.

Template

{% verbatim %}
  {% comment "Should we include this?" %}
    <small class="text-muted">
      Created on: {{ joke.created }}
      Last updated: {{ joke.updated }}
    </small>
  {% endcomment %}
{% endverbatim %}

Result

{% comment "Should we include this?" %}
<small class="text-muted">
  Created on: {{ joke.created }}
  Last updated: {{ joke.updated }}
</small>
{% endcomment %}

Notice that the Django template tags are output literally (i.e., verbatim).

Commentary

Hard to think of a use case for this.


Did we get something wrong? Is there a use case for the verbatim tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on Oct. 30, 2022, 1:22 p.m. EST