Skip to main content

django-admin-list-charts

Useful charts for Django admin, from one mixin.

Visits in light mode

Visits in dark mode

@admin.register(Order)
class OrderAdmin(ListChartMixin, admin.ModelAdmin):
    pass

Charts appear above the admin list controls and follow search and filters across all results. The timeline takes at least two-thirds of the width, with boolean rates and compact distributions stacked beside it. More charts reveals overflow charts and configured metrics. Django’s Show counts changes filter counts only. Light, dark and automatic themes work without configuration. Use arrow keys on a focused chart to explore points and Enter to filter.

See the gallery for desktop and mobile examples in light and dark mode.

Quick start

python -m pip install .

For a local checkout, use the command above. The published release can be installed with python -m pip install django-admin-list-charts==0.5.

Add 'admin_list_charts' to INSTALLED_APPS, then mix it into an admin:

from django.contrib import admin
from admin_list_charts.admin import ListChartMixin
from .models import Order

@admin.register(Order)
class OrderAdmin(ListChartMixin, admin.ModelAdmin):
    pass

Use your project's usual static-file deployment, including collectstatic. Chart.js and styles ship in the wheel. Runtime requires Django only; consumers need no Node, CDN, date adapter, migrations, or chart settings.

What happens automatically

The timeline uses an existing date_hierarchy, or prefers created_at, created, date_created, date_joined, published_at, published, then timestamp. Otherwise it uses a sole eligible date field. Modification fields and auto_now fields are excluded from inference. Ambiguous or absent dates leave distributions available. Inference never changes date_hierarchy or adds Django date navigation.

Up to two booleans become timeline rate overlays. Up to three choice/boolean fields become distributions, preferring the request's get_list_filter(request), followed by model choices and booleans. Single-valued related paths such as company__source and company__active work. Free text, identifiers, unrestricted relations, and multi-valued paths require explicit configuration. Numeric business metrics are always explicit.

Charts appear immediately, independently of Django's “Show counts”. Selection is deterministic. Empty and constant automatic charts are suppressed using their collected results; no replacement-candidate queries run. Default distributions show at most six categories. Long histories coarsen to at most 240 timeline buckets, with missing counts filled with zero and unknown rates/metrics left as gaps. Nullable booleans are excluded from rate denominators.

Chart labels omit a leading chart prefix and start with a capital letter.

Examples

python -m pip install -e .
python example_project/manage.py migrate
python example_project/manage.py seed_demo --reset --preset small --seed 42 --reference-date 2026-10-01
python example_project/manage.py createsuperuser
python example_project/manage.py runserver

Open /admin/. Visits, Orders, Accounts, and Jobs each use only the mixin. Separate advanced entries show filters, revenue/average metrics, annotated subscriptions with lazy loading, and related filters with duplicate-producing searches. All data is synthetic. Larger presets are 10000, 100000, and 1000000; reset is explicit.

Compatibility

Python Django
3.12, 3.13, 3.14 5.2 LTS, 6.0, 6.1
3.15 6.1.3 onward

SQLite and PostgreSQL are supported. Stock Django admin is the supported theme. Compatibility details, query budgets and performance, optional configuration, and 0.4 → 0.5 migration.

Development

DJANGO_SETTINGS_MODULE=tests.settings python -m django test tests
npm ci
npm run build
npx playwright install chromium
npm run test:browser
python -m build
python scripts/verify_package.py

The Node lockfile is development-only. The build registers only the bar/line components used and keeps Chart.js out of the global namespace. Browser tests pin Chromium, fonts, locale, timezone, seed, and reference date.

Inspired by Dani Hodovic's original article.

Browser baselines share the gallery images and target Chromium on macOS. Firefox and WebKit behavior checks can be run with PLAYWRIGHT_BROWSER=firefox npm run test:browser or PLAYWRIGHT_BROWSER=webkit npm run test:browser after installing those browsers with Playwright.

Metadata

Release files for django-admin-list-charts 0.5

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-admin-list-charts 0.5
File Size Uploaded Provenance Actions
django_admin_list_charts-0.5.tar.gz 1.1 MB Without provenance Details for django_admin_list_charts-0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-list-charts 0.5
File Interpreter ABI Platform Actions
django_admin_list_charts-0.5-py3-none-any.whl Python 3 none any Details for django_admin_list_charts-0.5-py3-none-any.whl

Total release size: 1.2 MB

Release files / django_admin_list_charts-0.5.tar.gz

Download URL django_admin_list_charts-0.5.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b5097e0e7ae989fd9d34e66037207b3e3debc6c29103d734d4d1ff2f62897eb0
BLAKE2b-256 checksum
How to use checksums
6359287304da535ccda428cdc18a37a069ed57e32c557f7fa77ac1a8046f7723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / django_admin_list_charts-0.5-py3-none-any.whl

Download URL django_admin_list_charts-0.5-py3-none-any.whl
Size 78.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb9c2aee1503b99d575f8ad923e015739af74a121071ba1daea442852aec4b9d
BLAKE2b-256 checksum
How to use checksums
9a57e707e5395503d27d86e7576f190d061e7dd82eb91a06b0ead150a9af7f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for django-admin-list-charts 0.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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