Adds filtering by ranges of dates in the admin filter sidebar.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 75 commits ahead of coolchevy:master.
Latest commit 603ee58 Jun 7, 2017



Check this PR to get more info:

Build status


Add the option to filter by a custom date range on the admin. This allows to inputs to be used to get the custom date range filters.

See datefilter.png of a screenshot of how this is seen on the admin.

IMPORTANT: this will work with Django 1.4. I won't work with previous Django versions.


Use pip/easy_install

pip install django-daterange-filter

Add daterange_filter to settings.INSTALLED_APP. For this, edit the file:


After this, if you have a model like this one:

class MyModel(models.Model):
    foo = models.CharField(max_length=1, choices=BAR_CHOICES)
    created_at = models.DateField()

To allow to filter the created_at field using the date ranges, you must edit the admin.ModelAdmin referenced to that class:

from daterange_filter.filter import DateRangeFilter
from django.contrib import admin
from models import MyModel

class MyModelAdmin(admin.ModelAdmin):
    list_filter = (
        ('created', DateRangeFilter), # this is a tuple

DateRangeFilter honours localization and supports local date formats for filtering.

Running tests

First pip install -r requirements.txt, then python ./

If you wanna run tests on all supported Python/Django versions, execute tox.





  • Updated README
  • Works with DateTime (special thanks to Andrea Rabbaglietti)