Skip to content
django-admin-rangefilter app, add the filter by a custom date range on the admin UI
Python HTML JavaScript Makefile
Branch: master
Clone or download
Latest commit 72336cb Jul 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/images Init commit Jun 24, 2016
rangefilter Prepare 0.5.0 Jul 4, 2019
.gitignore Updated translation Jan 31, 2019
.travis.yml Fix travis dist Apr 5, 2019
CHANGELOG.md Prepare 0.5.0 Jul 4, 2019
LICENSE Init commit Jun 24, 2016
MANIFEST.in Prepare 0.5.0 Jul 4, 2019
Makefile Update makefile now clean __pycache__ Jun 21, 2019
README.rst Fix README Jul 4, 2019
runtests.py Compatibility Django 2.1 Apr 5, 2019
setup.py Fix problem when thousand separator is used (#18) May 14, 2019

README.rst

https://travis-ci.org/silentsokolov/django-admin-rangefilter.svg?branch=master

django-admin-rangefilter

django-admin-rangefilter app, add the filter by a custom date / datetime range on the admin UI.

https://raw.githubusercontent.com/silentsokolov/django-admin-rangefilter/master/docs/images/screenshot.png

Requirements

  • Python 2.7+ or Python 3.4+
  • Django 1.8+

Installation

Use your favorite Python package manager to install the app from PyPI, e.g.

Example:

pip install django-admin-rangefilter

Add rangefilter to INSTALLED_APPS:

Example:

INSTALLED_APPS = (
    ...
    'rangefilter',
    ...
)

Example usage

In admin

from django.contrib import admin
from rangefilter.filter import DateRangeFilter, DateTimeRangeFilter

from .models import Post


@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
    list_filter = (
        ('created_at', DateRangeFilter), ('updated_at', DateTimeRangeFilter),
    )

Support Content-Security-Policy

For Django 1.8+, if django-csp is installed, nonces will be added to style and script tags.

INSTALLED_APPS = (
    ...
    'rangefilter',
    'csp',
    ...
)
You can’t perform that action at this time.