[Django]-Django humanize outside of template?

78👍

Yes you can

Lets say you want to call naturalday in views.py you would do

from django.contrib.humanize.templatetags.humanize import naturalday
natural_day = naturalday(value)

You can refer to the source code here for the signature, and options

Leave a comment