Django Template Tags and Filters
The purpose of this website is to provide useful documentation on Django’s 58 built-in template filters and 31 built-in template tags. While the official documentation is very good, we have attempted to organize the tags and filters in a more meaningful way, and to give a better sense of how and if/when to use each one.
Filters
Coding Filters
addslashes
escape
escapejs
escapeseq
New in Django 5.0
force_escape
json_script
Most useful
linebreaks
linebreaksbr
pprint
safe
Most useful
striptags
Data Structure Filters
Date and Time Filters
Formatting Filters
Logic Filters
Number Filters
add
divisibleby
filesizeformat
Most useful
floatformat
Most useful
get_digit
length
Most useful
wordcount
String Filters
cut
linenumbers
phone2numeric
pluralize
Most useful
stringformat
truncatechars
truncatechars_html
truncatewords
truncatewords_html
Most useful
wordwrap
URL Filters
Tags
Coding Tags
Logic Tags
cycle
Most useful
firstof
for
Most useful
for … empty
Most useful
if
Most useful
ifchanged
ifequal
Removed in Django 4.0
ifnotequal
Removed in Django 4.0
resetcycle
with
Most useful
Utility Tags
block
Most useful
comment
Most useful
csp_nonce_attr
New in Django 6.1
csrf_token
Most useful
debug
extends
Most useful
filter
include
Most useful
load
Most useful
lorem
now
partial
New in Django 6.0
Most useful
partialdef
New in Django 6.0
Most useful
querystring
New in Django 5.1
Most useful
regroup
url
Most useful
