Skip to main content

Date range filter for Django admin

Project description

Django admin date range filter

Build Status GitHub release PyPI release Python version GitHub issues Code quality Coverage GitHub license

Application adds three Django admin list filters: DateRangeFilter, PastDateRangeFilter and FutureDateRangeFilter. These filters let user filter models by date range. PastDateRangeFilter and FutureDateRangeFilter add quick selection of predefined date ranges. Filters can be applied to any model date fields. Application supports default Django admin theme and Suit theme.

Admin screenshot


  • Python 2.7+ or Python 3.3+
  • Django 1.9+


Install django-daterangefilter using pip:

pip install django-daterangefilter

Add daterangefilter to INSTALLED_APPS. Example:


Application uses static files so do not forget to issue collectstatic management command in production environment.

Example usage


from django.contrib import admin
from daterangefilter.filters import PastDateRangeFilter, FutureDateRangeFilter

class PostAdmin(admin.ModelAdmin):
    list_filter = [
        ('created_at', PastDateRangeFilter), ('publish_at', FutureDateRangeFilter)

Advanced usage

Predefined ranges can be completely redefined by overriding _past_ranges.html and _future_ranges.html templates. Take into account that these templates are inserted in the middle of the javascript code and may contain nothing but ranges definition. For more examples on using moment library refer to library documentation.


Filter widget uses a great JavaScript date range picker component - Date Range Picker by Dan Grossman.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-daterangefilter, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django_daterangefilter-1.0.0-py2.py3-none-any.whl (111.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-daterangefilter-1.0.0.tar.gz (106.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page