Skip to main content

django-bootstrap6-admin

CI PyPI Python Django License: MIT

A modern, responsive Bootstrap 6 skin for the Django admin. It replaces the default admin templates and static assets without monkey-patching Django, changing admin classes, adding database queries, or requiring migrations.

The package is a thin presentation layer: Django's admin views, forms, permissions and JavaScript remain in charge.

Features

  • Bootstrap 6 markup and design tokens throughout the admin.
  • "View site" is always available in the top bar, not buried in the user menu.
  • Sticky top bar with a collapsible sidebar (desktop) and drawer navigation with a backdrop (mobile).
  • Dashboard with application cards in a three-column grid, model shortcuts and recent actions to the right.
  • Changelist with search, date hierarchy, collapsible filters, sortable headers, bulk actions and Bootstrap pagination. The desktop filter panel can be collapsed, and both its state and the "Show counts" choice are remembered between pages.
  • Subtle vertical rules separate columns in changelists, inline tables and the object history.
  • Change form with card-based fieldsets, collapsible sections, a clear save bar, tabular/stacked inlines and related-object popups.
  • Theme-aware date and time fields with compact Today/Now actions, calendar and clock dialogs, and proper dark-mode contrast.
  • Modern login, logout and password change pages.
  • Light, dark and system themes. The existing Django theme localStorage preference is synchronised with Bootstrap's data-bs-theme attribute.
  • Dark-theme secondary text, table headers, filter links and help text use higher-contrast tokens for better readability.
  • Soft fade-in/fade-out transition when switching themes, skipped automatically for users who prefer reduced motion.
  • Every click changes the visible theme: if auto would resolve to the theme already on screen, the toggle skips that step instead of appearing to do nothing.
  • Accessible focus states, labels, table headers and ARIA attributes.
  • All Django admin JavaScript hooks are preserved: actions.js, filters.js, nav_sidebar.js, inlines, Select2/autocomplete, calendar widgets and related-object lookups.
  • CSP-aware: bundled scripts and styles use Django 6.1's {% csp_nonce_attr %} tag, so nonce-based policies work out of the box.
  • Generic by design: no models, no migrations, no project-specific imports and no assumptions about the host project's branding. The default warm near-black/yellow palette is only a set of overridable CSS variables.

Requirements

Component Supported versions
Python 3.12, 3.13, 3.14
Django 6.1.x
Bootstrap 6.0.0-alpha.1 (bundled)

Django 6.1 is required because the templates use the {% csp_nonce_attr %} template tag and the change-form admin actions added in that release. Django 5.2 LTS and 6.0 are not supported by this version.

Installation

pip install django-bootstrap6-admin

Add the app before django.contrib.admin so its admin/ templates take precedence:

INSTALLED_APPS = [
    "django_bootstrap6_admin",
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    # ...
]

That's it. There are no settings to add, no migrations and no URL changes.

For a local checkout:

git clone https://github.com/asandikci/django-bootstrap6-admin.git
cd django-bootstrap6-admin
python -m pip install -e .

What gets overridden

The app provides templates for the standard Django admin pages, including:

  • admin/base.html, base_site.html, index.html, app_list.html
  • admin/change_list.html, change_form.html, delete_confirmation.html
  • admin/edit_inline/stacked.html, edit_inline/tabular.html
  • admin/login.html, admin/object_history.html
  • admin/auth/user/add_form.html, admin/auth/user/change_password.html
  • registration/logged_out.html, registration/password_change_form.html and registration/password_change_done.html

Only the three auth templates used directly by the admin site are shipped. They still live in Django's global registration/ namespace, so they also apply to those views if a project uses them outside the admin; override them if you need separate public-site auth screens. Password reset templates are intentionally left to the host project, because reset URLs and their branding usually belong to the public site rather than to the admin package.

Customisation

Long change forms

The action bar sits at the end of the form by default. For long forms, enable Django's standard top action bar on a ModelAdmin:

class BookAdmin(admin.ModelAdmin):
    save_on_top = True

Branding

Use Django's existing admin site settings:

from django.contrib import admin

admin.site.site_header = "Acme administration"
admin.site.site_title = "Acme"
admin.site.index_title = "Operations"

Templates

Every block from Django's admin base templates is preserved. Override any template normally, for example templates/admin/base_site.html, or extend the provided template:

{% extends "admin/base_site.html" %}

{% block branding %}
  {{ block.super }}
  <span class="badge badge-subtle theme-info">Internal</span>
{% endblock %}

Colours

The skin uses Bootstrap 6 design tokens (--bs-*) and a small set of --ba-* variables. Override them after the admin stylesheet, for example in a custom admin CSS file:

:root {
    --ba-topbar-bg: #231f20;
    --ba-gold: #ffcb08;
    --ba-canvas: #f6f6f4;
    --ba-sidebar-width: 300px;
}

The default primary is the warm yellow accent with dark text, and the danger colour remains a deep red for readable white labels.

The select controls use small data: SVG arrows. If you enable a strict CSP, allow img-src 'self' data: (or replace the arrows in your own CSS).

Turning it off

Remove django_bootstrap6_admin from INSTALLED_APPS (or move it after django.contrib.admin) and the default Django admin returns immediately. There is no runtime state to clean up.

How it works

  • The app only contributes templates and static files.
  • Django's admin views and forms are untouched.
  • Django's own JavaScript remains the source of truth for the sidebar state, filters, bulk actions and inlines.
  • The bundled theme.js reads and writes Django's theme localStorage key and mirrors it to data-bs-theme; it does not replace Django's admin behaviour.
  • Bootstrap 6 is pinned as 6.0.0-alpha.1 in static/django_bootstrap6_admin/vendor/bootstrap/ to keep the visual result stable. Its MIT licence is included next to the assets. SHA-256 of the bundled files:
    • bootstrap.min.css: 678508b198d9b1b8877e338f419fdada00024be2bcc638a539dd724856095112
    • bootstrap.bundle.min.js: 47ea447f46e288dd9d3e83147b7ba539c6df5192c047b8f91739cd56a5721148

Language

Django's admin is translated using the active language; it is not fixed to English. With LANGUAGE_CODE = "tr", Django's own admin labels are Turkish, and this theme follows the same project language. The package's source strings are English and are translated when a matching locale is installed. To keep the admin in English while the public site uses another language, activate English for /admin/ in your project (for example with a small middleware), or set LANGUAGE_CODE = "en-us" if the whole site should be English.

Development

The test suite uses an isolated settings module and a small demo app. Create a virtual environment and install the package in editable mode:

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Run the tests and the linter:

python -m django test --settings=tests.settings
node tests/js/theme_toggle.test.js
ruff check .
ruff format --check .

Build and validate the distribution:

python -m build
python -m twine check --strict dist/*

The same checks run in GitHub Actions on Python 3.12, 3.13 and 3.14.

Releasing

Releases are published from a v* tag with PyPI Trusted Publishing. See CONTRIBUTING.md for the complete release checklist and the one-time PyPI publisher setup.

Licence

MIT. The admin templates are derived from Django's BSD-licensed admin templates, and Bootstrap is distributed under the MIT licence. See NOTICE and static/django_bootstrap6_admin/vendor/bootstrap/LICENSE for the full attribution and licence texts.

Metadata

Release files for django-bootstrap6-admin 0.2.4

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-bootstrap6-admin 0.2.4
File Size Uploaded Provenance Actions
django_bootstrap6_admin-0.2.4.tar.gz 174.1 kB With provenance Details for django_bootstrap6_admin-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-bootstrap6-admin 0.2.4
File Interpreter ABI Platform Actions
django_bootstrap6_admin-0.2.4-py3-none-any.whl Python 3 none any Details for django_bootstrap6_admin-0.2.4-py3-none-any.whl

Total release size: 353.9 kB

Release files / django_bootstrap6_admin-0.2.4.tar.gz

Download URL django_bootstrap6_admin-0.2.4.tar.gz
Size 174.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f19aa99832fac51d2da13489ed5bcafefb6514e174c52ebac801481dd0343bff
BLAKE2b-256 checksum
How to use checksums
e2daca4a6d014ac2ff574c6517741b7fbeeeb81fe499223448935e6046bd956c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / django_bootstrap6_admin-0.2.4-py3-none-any.whl

Download URL django_bootstrap6_admin-0.2.4-py3-none-any.whl
Size 179.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bbad2b89938ac9c15e970f849c6ec415dfdc61a90849d6bbba512a9e94be885
BLAKE2b-256 checksum
How to use checksums
f4060ece762532d1174b5b103acff98526bb86d738dd214957c521a15dc60b9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for django-bootstrap6-admin 0.2.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_bootstrap6_admin-0.2.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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