Django Template Tags Reference
Template Tags Reference
A list of all template tags:
Tag | Description |
---|---|
autoescape | Specify if autoescape mode is on or off |
block | Specify a block section |
comment | Specify a comment section |
csrf_token | Protects forms from Cross Site Request Forgeries |
cycle | Specifies content to use in each cycle of a loop |
debug | Specifies debugging information |
extends | Specifies a parent template |
filter | Filters content before returning it |
firstof | Returns the first not empty variable |
for | Specify a for loop |
if | Specifies an if statement |
ifchanged | Used in for loops. Outputs a block only if a value has changed since the last iteration |
include | Specifies included content/template |
load | Loads template tags from another library |
lorem | Outputs random text |
now | Outputs the current date/time |
regroup | Sorts an object by a group |
resetcycle | Used in cycles. Resets the cycle |
spaceless | Removes whitespace between HTML tags |
templatetag | Outputs a specified template tag |
url | Returns the absolute URL part of a URL |
verbatim | Specify contents that should not be rendered by the template engine |
widthratio | Calculates a width value based on the ratio between a given value and a max value |
with | Specify a variable to use in the block |