Skip to main content

Django admin date range filter

Test status GitHub release PyPI release Python version GitHub issues 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

Requirements

  • Python 3.10+
  • Django 5.2+ (5.2, 6.0 and 6.1 are tested)

Installation

Install django-daterangefilter using pip:

pip install django-daterangefilter

Add daterangefilter to INSTALLED_APPS. Example:

INSTALLED_APPS = (
    ...
    'daterangefilter',
    ...
)

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

Example usage

in admin.py:

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

@admin.register(Post)
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.

Development

Tests are run with tox against all supported Python and Django versions:

pip install tox
tox                             # all available Python versions
tox -e py313-django61           # particular environment
python runtests.py              # current virtual environment

To release a new version, update version in pyproject.toml, commit the change and push a tag with the same version:

git tag v1.3
git push origin v1.3

GitHub workflow runs the tests, publishes the package to TestPyPI and PyPI and creates GitHub release.

Credits

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

Metadata

Release files for django-daterangefilter 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-daterangefilter 1.3
File Size Uploaded Provenance Actions
django_daterangefilter-1.3.tar.gz 109.1 kB With provenance Details for django_daterangefilter-1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-daterangefilter 1.3
File Interpreter ABI Platform Actions
django_daterangefilter-1.3-py3-none-any.whl Python 3 none any Details for django_daterangefilter-1.3-py3-none-any.whl

Total release size: 220.7 kB

Release files / django_daterangefilter-1.3.tar.gz

Download URL django_daterangefilter-1.3.tar.gz
Size 109.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7ac68d5b8b20f5d13c42fd9e25e1c4ba7a54c41ed03b16b48e32d92b601f959f
BLAKE2b-256 checksum
How to use checksums
07c2509d84e7d5087758059104039cf692d1f207ad7bdcb9ae310d1a44008547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / django_daterangefilter-1.3-py3-none-any.whl

Download URL django_daterangefilter-1.3-py3-none-any.whl
Size 111.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91ab33e3fe49b01f0cf889f09a8a95b94549bbdaa3422b86f2d2db0589611998
BLAKE2b-256 checksum
How to use checksums
10416ac9c328552682931e4d31e412a92e5d59d2f16b65e41b7dbfcbdd99e354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for django-daterangefilter 1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_daterangefilter-1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page