Registry / web-framework / django-admin-rangefilter

django-admin-rangefilter

JSON →
library0.15.0pypypi✓ verified 28d ago

django-admin-rangefilter is a Django application that enhances the admin UI by adding custom date, datetime, and numeric range filters. It is currently at version 0.13.5 and maintains an active release cadence, frequently updating for Django compatibility and bug fixes.

pip install django-admin-rangefilter
INSTALL
IMPORT
SIG · DJANGO-ADMIN-RANGE
D
django-admin-rangefilter
web-frameworkpythonv0.15.0
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.15.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DateRangeFilter
✓ from rangefilter.filters import DateRangeFilter
✗ from rangefilter.filters import DateRangeFilter

First, add 'rangefilter' to your `INSTALLED_APPS` in `settings.py`. Then, in your `admin.py`, import the desired filter classes (e.g., `DateRangeFilter`, `DateTimeRangeFilter`, `NumericRangeFilter`) and apply them to fields in your `ModelAdmin`'s `list_filter` attribute. For date/datetime fields, simply specify the field name and filter class. For numeric fields, specify the field name and `NumericRangeFilter`.

# settings.py INSTALLED_APPS = [ # ... 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', # ... 'rangefilter', # ... ] # models.py (example) from django.db import models class MyModel(models.Model): name = models.CharField(max_length=100) created_at = models.DateField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) price = models.DecimalField(max_digits=10, decimal_places=2, default=0.00) def __str__(self): return self.name # admin.py from django.contrib import admin from rangefilter.filters import DateRangeFilter, DateTimeRangeFilter, NumericRangeFilter from .models import MyModel @admin.register(MyModel) class MyModelAdmin(admin.ModelAdmin): list_display = ('name', 'created_at', 'updated_at', 'price') list_filter = ( ('created_at', DateRangeFilter), ('updated_at', DateTimeRangeFilter), ('price', NumericRangeFilter), # Add 'collapsible=True' for Django >= 4.1: # ('created_at', {'filter_class': DateRangeFilter, 'collapsible': True}), )
Debug
Known issues
breakingVersion 0.13.0 introduced a change to the default range template and added support for collapsible filters (Django >= 4.1). If you have custom templates overriding `rangefilter/date_filter.html` or similar, they might require adjustments to work with this new version and take advantage of new features.
fix
Review any custom `rangefilter` templates for compatibility with changes introduced in v0.13.0, especially if targeting Django 4.1+ for collapsible filters.
affects: 0.13.0+
gotchaIt's a common mistake to forget adding 'rangefilter' to your `INSTALLED_APPS` in `settings.py`. Without this, the custom filters will not be registered correctly and will not appear in the admin interface.
fix
Ensure 'rangefilter' is present in your `INSTALLED_APPS` list in `settings.py`.
affects: All
gotchaPrior to version 0.13.3, there was a bug that prevented users from clearing filters properly. This could lead to confusing UX where applied filters could not be reset.
fix
Upgrade to version 0.13.3 or newer to resolve the filter clearing issue.
affects: <0.13.3
gotchaThe `collapsible` filter option, introduced in v0.13.0, is only supported for Django versions 4.1 and higher. Attempting to use it with older Django versions will not have the desired effect and might lead to unexpected rendering.
fix
Only apply `collapsible=True` in `list_filter` for Django projects running version 4.1 or higher. Example: `('created_at', {'filter_class': DateRangeFilter, 'collapsible': True})`
affects: 0.13.0+
gotchaIn versions prior to 0.12.2 (specifically fixed in 0.12.1 and 0.12.2), `DateTimeRangeFilter` might have incorrectly handled microsecond precision for upper time bounds, potentially excluding valid entries or providing incorrect range filtering for `DateTimeField`s.
fix
Upgrade to version 0.12.2 or newer to ensure correct microsecond handling in `DateTimeRangeFilter`.
affects: <0.12.2
Upgrade
Version history
0.15.0latest on PyPI · released Aug 28, 2026
Audit
Dependencies
DjangorequiredThis is a Django admin application and requires Django to function.
Agent activity
14 hits · last 30 days
node
12
Resources
django-admin-rangefilter — pip install django-admin-rangefilter · libregistry