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.
  • Sticky top bar with a collapsible sidebar (desktop) and drawer navigation with a backdrop (mobile).
  • Dashboard with application cards, model shortcuts and recent activity.
  • Changelist with search, date hierarchy, collapsible filters, sortable headers, bulk actions and Bootstrap pagination.
  • Change form with card-based fieldsets, collapsible sections, a clear save bar, tabular/stacked inlines and related-object popups.
  • 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.
  • 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 navy/gold 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: #1f2937;
    --ba-gold: #f59e0b;
    --ba-sidebar-width: 300px;
}

The default primary and danger colours are deliberately deeper than Bootstrap 6's defaults so white button text meets WCAG AA contrast.

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

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
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.1.0

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.1.0
File Size Uploaded Provenance Actions
django_bootstrap6_admin-0.1.0.tar.gz 167.3 kB With provenance Details for django_bootstrap6_admin-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 343.7 kB

Release files / django_bootstrap6_admin-0.1.0.tar.gz

Download URL django_bootstrap6_admin-0.1.0.tar.gz
Size 167.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4d418084ee762da3ea919c8396a98b916391aba423e64390971080a8398f11d7
BLAKE2b-256 checksum
How to use checksums
9081e6134c20ab1595be982523382da82c8c59b0b80e9f84f38de0a3f1f90bed
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.1.0-py3-none-any.whl

Download URL django_bootstrap6_admin-0.1.0-py3-none-any.whl
Size 176.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f4e3cf6df2bca0dabca12eb813ab70d61cf2b1caec6e7653a495c54eccbb037
BLAKE2b-256 checksum
How to use checksums
006566492e3468a7885322ee39eb595a2df20cbcc101d79210e9c950da752de8
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.1.0

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.1.0.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