Built-in Django tags
Django offers several built-in tags that offer immediate access to elaborate operations on Django templates. Unlike Django filters which operate on individual variables, tags are designed to produce results without a variable or operate across template sections.
I'll classify each of these built-in tags into functional sections so it's easier to identify them. The functional classes I'll use are: Dates, forms, comparison operations, loops, Python & filter operations, spacing and special characters, template structures, development and testing & urls.
Dates
{% now %}
.- The{% now %}
tag offers access to the current system time. The{% now %}
tag accepts a second argument to format the system date. For example, if the system date is 01/01/2022 for the statement{% now "F jS o" %}
the tag output is January 1st 2022. The string syntax for the{% now %}
tag is based on Django date characters described in table 3-3. It's also possible to use theas
keyword to re-use the value through a variable(e.g.{% now "Y" as current_year %}
and later in the template declareCopyright {{current_year}}
).
The remaining content for Django 4.0 is only available with a subscription.