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. For a field that can be empty, the picker also offers "No date", which shows the objects without a date (in the default admin theme). 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.4

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.4
File Size Uploaded Provenance Actions
django_daterangefilter-1.4.tar.gz 110.0 kB With provenance Details for django_daterangefilter-1.4.tar.gz

Built distribution (wheel)

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

Total release size: 222.5 kB

Release files / django_daterangefilter-1.4.tar.gz

Download URL django_daterangefilter-1.4.tar.gz
Size 110.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6c18f5852ed58c53c22607db85fe36f2d34466c2d93dbe3e956c138db5779e58
BLAKE2b-256 checksum
How to use checksums
f37e705eafb57464002344d211acda10d7a1232f4e3661d9c8cfe4da4c99d47e
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.4-py3-none-any.whl

Download URL django_daterangefilter-1.4-py3-none-any.whl
Size 112.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dfee8f652a3c92d1bcdc3bc8455be3ae1d26c5ea7451d8244a25e4b6e4424c3
BLAKE2b-256 checksum
How to use checksums
ebaff6b63941282d081e876d5fd3f6bf653bb8e6945b19ff2ce028b6e4f4650a
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.4

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.4.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