Django Humanize Filters
A snippet showing how to use humanize in templates.
# settings.py
INSTALLED_APPS += ['django.contrib.humanize']
# template.html
{% load humanize %}
<p>{{ 1200000|intcomma }}</p>
<p>{{ 3|apnumber }} apples</p>
<p>{{ ts|naturaltime }}</p>
Explanation:
-
Enable
django.contrib.humanizeinINSTALLED_APPS. -
Load with
{% load humanize %}to use filters likeintcommaandnaturaltime.
- Category Utilities & Miscellaneous
- Total Views 252
- Last Modified 20 June, 2026
- Tags #humanize #templates #utilities #filters
Previous snippet
Background Tasks with Celery
Next snippet