Requires {% load humanize %}
Add {% load humanize %} near the top of any template that
uses |naturaltime. Without it Django does not
know the name and raises TemplateSyntaxError.
{% load humanize %} only works when
"django.contrib.humanize" is in your
INSTALLED_APPS — the load fails before the
library is ever reached.
Turns a datetime into how far it is from now, in the phrasing a person would use.
Template
{% load humanize %}
<p>Last seen {{ user.last_login|naturaltime }}</p>
Result
<p>Last seen 29 seconds ago</p>
Future datetimes are phrased forwards — “an hour from now” — so it reads correctly either side of the present. Unlike timesince, it needs no second argument and handles the “now” case itself.
