templatetag Tag

Coding

Argument(s): various

Documentation

Outputs special characters used to create template tags (e.g., braces and percentage signs).

Template

{% templatetag openblock %} tag {% templatetag closeblock %}
{% templatetag openvariable %} variable {% templatetag closevariable %}
{% templatetag openbrace %} braces {% templatetag closebrace %}
{% templatetag opencomment %} comment {% templatetag closecomment %}

Result

{% tag %}
{{ variable }}
{ braces }
{# comment #}

Commentary

Unless you’re planning to write an online Django tutorial in which you need to output symbols used in Django templates, you’re unlikely to need this tag.


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

Send Feedback

Official Documentation
This page last updated on April 14, 2020, 6:59 p.m. EST