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-rangefilterVerified import paths — ran on the pinned version, not inferred.
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`.
Review any custom `rangefilter` templates for compatibility with changes introduced in v0.13.0, especially if targeting Django 4.1+ for collapsible filters.
Ensure 'rangefilter' is present in your `INSTALLED_APPS` list in `settings.py`.
Upgrade to version 0.13.3 or newer to resolve the filter clearing issue.
Only apply `collapsible=True` in `list_filter` for Django projects running version 4.1 or higher. Example: `('created_at', {'filter_class': DateRangeFilter, 'collapsible': True})`Upgrade to version 0.12.2 or newer to ensure correct microsecond handling in `DateTimeRangeFilter`.