When talking about creation or modification dates, it is convenient to read a more human-readable time difference—for example, the blog entry was posted 3 days ago, the news article was published today, and the user last logged in yesterday. In this recipe, we will create a template filter named date_since, which converts dates to humanized time differences based on days, weeks, months, or years.
Creating a template filter to show how many days have passed since a post was published
Getting ready
Create the core app, and put it under INSTALLED_APPS in the settings, if you haven't done so already. Then, create a templatetags Python package in this app (Python packages are directories with an empty __init__.py file...