htmx-powered theme + helpers for django.contrib.admin. Picnic CSS, native HTML5 widgets, two mandatory dependencies.
Project description
django-yp-admin
An htmx-powered theme + helpers for django.contrib.admin. Two dependencies. Zero jQuery.
django-yp-admin is an htmx-powered admin theme plus a small set of helpers for django.contrib.admin. It ships template overrides (Picnic CSS, native HTML5 widgets, htmx) and a handful of reusable abstract models and admin mixins (OrderedModel, SingletonModel, lightweight history, htmx widgets). It is not a full drop-in replacement for django.contrib.admin — it layers on top of the stock AdminSite.
Status: v0.1, pre-alpha. ~19 tests in the suite. We have not yet validated against custom
AdminSitesubclasses or third-party admin packages (django-cms, wagtail, allauth, django-guardian, django-polymorphic, etc.). API will change.
What you get
- htmx-powered theme. Template overrides for changelist/change form/login. Picnic CSS base, themable via CSS custom properties. Dark mode via
prefers-color-scheme. - No jQuery. ~62KB gzipped of total JS instead of ~250KB of jQuery + Select2 + xregexp.
- Two mandatory deps. Django +
django-htmx. Optional extras when you want them. - Native HTML5.
<input type="date">,<dialog>,<details>instead of jQuery widgets. - Helpers (opt-in). Abstract models and admin mixins you can mix into your own code:
OrderedModel+ drag-and-drop adminSingletonModel+ admin- Lightweight history (Revision/Version)
- htmx-native filters (Dropdown, DateRange, DateTimeRange, NumericRange)
- htmx + Tom Select autocomplete widget
- htmx-native nested/sortable inlines
What is NOT yet supported / tested
This is v0.1. The following are roadmap, not promises:
- Custom
AdminSitesubclasses — untested. - django-cms, wagtail, allauth admin integrations — untested.
- django-guardian (
GuardedModelAdmin), django-polymorphic (PolymorphicChildModelAdmin), django-reversion (VersionAdmin), django-import-export (ImportExportModelAdmin) — not yet validated end-to-end. - Third-party themes that target legacy admin CSS classes — selectors are preserved as DOM hooks but not regression-tested.
- Legacy admin JS extensions that depend on
django.jQuery— will break.
If you depend on any of the above, stay on django.contrib.admin for now and watch this project.
Optional extras
pip install django-yp-admin[history] # django-simple-history
pip install django-yp-admin[import-export] # django-import-export
pip install django-yp-admin[full] # all of the above
When the optional package is installed, the matching admin integration in django_yp_admin.contrib activates automatically via importlib.util.find_spec. These integrations are exercised by the test suite at a basic level — production hardening pending.
Quickstart
pip install django-yp-admin
INSTALLED_APPS = [
"django_yp_admin", # before django.contrib.admin
"django.contrib.admin",
"django_htmx",
# ...
]
MIDDLEWARE = [
# ...
"django_htmx.middleware.HtmxMiddleware",
]
Open /admin/. Stock admins keep working with the new theme. To opt into htmx-native filters/widgets per model, switch your ModelAdmin base class to django_yp_admin.options.ModelAdmin.
Browser support
Modern browsers only — last 3 years of releases.
| Browser | Minimum |
|---|---|
| Firefox | 115 (ESR, July 2023) |
| Chrome | 115 (July 2023) |
| Safari | 16.4 (March 2023) |
| Edge | 115 (Chromium) |
This unlocks native <dialog>, :has(), CSS nesting, container queries, reliable date inputs, and ES2022 — which is why the JS bundle is so small.
If you need legacy browser support, stick with django.contrib.admin.
Stack
| Layer | Tool | Size (gzip) |
|---|---|---|
| AJAX | htmx | ~14KB |
| Local UI state (optional) | Alpine.js | ~15KB |
| Autocomplete | Tom Select | ~25KB |
| CSS base | Picnic CSS | ~10KB |
| Our code | TypeScript bundled with Bun | ~8KB |
| Total | ~62KB |
vs the default admin's ~250KB of jQuery + Select2 + xregexp + custom JS.
Status
v0.1, pre-alpha. ~19 tests. API will change. Star the repo, file issues, send PRs. Real-world compat reports against custom AdminSite and third-party admin packages are especially welcome.
License
MIT. © Yp Software info@ypsoftware.com.py.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_yp_admin-0.1.1.tar.gz.
File metadata
- Download URL: django_yp_admin-0.1.1.tar.gz
- Upload date:
- Size: 140.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b100f51c585c578323a17027ff9146d9068cfdb0045e62ff4ec646afbaacda9
|
|
| MD5 |
98cc9b40c2b110b43bfd12b6a0fbc7c7
|
|
| BLAKE2b-256 |
6d9e328dc890673311687a13f4e438733466c9dce4fc73cd5cd3545820b052ee
|
Provenance
The following attestation bundles were made for django_yp_admin-0.1.1.tar.gz:
Publisher:
publish.yml on ypsoftware/django-yp-admin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_yp_admin-0.1.1.tar.gz -
Subject digest:
9b100f51c585c578323a17027ff9146d9068cfdb0045e62ff4ec646afbaacda9 - Sigstore transparency entry: 1401579841
- Sigstore integration time:
-
Permalink:
ypsoftware/django-yp-admin@c754f17d20bbc25949929eb0250a399aa730adc1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ypsoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c754f17d20bbc25949929eb0250a399aa730adc1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_yp_admin-0.1.1-py3-none-any.whl.
File metadata
- Download URL: django_yp_admin-0.1.1-py3-none-any.whl
- Upload date:
- Size: 147.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fad679a60b17d024a4b83c7486f4bddabd343d95fb9e2c9077b7a96082c1f2d1
|
|
| MD5 |
8f79c4e915ed692f5eedc47a92aa686c
|
|
| BLAKE2b-256 |
5be291f7348965cf024763be3a5db8b0d1985324a63248b437f4e1c6ba9d5467
|
Provenance
The following attestation bundles were made for django_yp_admin-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ypsoftware/django-yp-admin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_yp_admin-0.1.1-py3-none-any.whl -
Subject digest:
fad679a60b17d024a4b83c7486f4bddabd343d95fb9e2c9077b7a96082c1f2d1 - Sigstore transparency entry: 1401579936
- Sigstore integration time:
-
Permalink:
ypsoftware/django-yp-admin@c754f17d20bbc25949929eb0250a399aa730adc1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ypsoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c754f17d20bbc25949929eb0250a399aa730adc1 -
Trigger Event:
push
-
Statement type: