Tags
31 tags
- autoescape turns autoescaping of HTML on or off.
- block delineates a block of content that can be overwritten in child templates. Most useful
- comment used to comment out code. Most useful
-
csp_nonce_attr
renders the CSP nonce attribute on
<script>and<link>tags. New in Django 6.1 - csrf_token protects against cross site request forgery. Most useful
- cycle cycles through list of arguments. Most useful
- debug outputs debugging information.
- extends signals that the template extends a parent template. Most useful
- filter applies a pipe-delimited list of filters to the contained content.
-
firstof
returns the first argument in a list of arguments that evaluates to
True. - for for loop. Most useful
- for … empty display text when for loop is empty. Most useful
- if if condition. Most useful
- ifchanged checks if value in loop has changed since last iteration.
-
ifequal
Removed. Use
{% if a == b %}instead. Removed in Django 4.0 -
ifnotequal
Removed. Use
{% if a != b %}instead. Removed in Django 4.0 - include used to include one template in another. Most useful
- load used to load one or more libraries of tags and filters. Most useful
- lorem outputs lorem ipsum placeholder text.
- now outputs the current date and/or time.
-
partial
renders a template fragment defined with
partialdef. New in Django 6.0 Most useful - partialdef defines a reusable template fragment. New in Django 6.0 Most useful
- querystring outputs a URL-encoded query string. New in Django 5.1 Most useful
- regroup used for outputting list of dictionaries in different orders and structures.
-
resetcycle
used to reset a
cycle. - spaceless removes irrelevant whitespace between HTML tags.
- templatetag Outputs special characters used to create template tags.
-
url
used to output the path to the view mapping to
urlnameas defined in the URLConf file. Most useful - verbatim turn off template rendering.
- widthratio used to create bar charts and the like.
- with caches a variable for reuse. Most useful
