django-bootstrap6-admin 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_bootstrap6_admin-0.1.0/CHANGELOG.md +22 -0
- django_bootstrap6_admin-0.1.0/CONTRIBUTING.md +102 -0
- django_bootstrap6_admin-0.1.0/LICENSE +21 -0
- django_bootstrap6_admin-0.1.0/MANIFEST.in +10 -0
- django_bootstrap6_admin-0.1.0/NOTICE +48 -0
- django_bootstrap6_admin-0.1.0/PKG-INFO +262 -0
- django_bootstrap6_admin-0.1.0/README.md +225 -0
- django_bootstrap6_admin-0.1.0/pyproject.toml +78 -0
- django_bootstrap6_admin-0.1.0/setup.cfg +4 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/__init__.py +3 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/apps.py +13 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/css/admin.css +3530 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/css/widgets-overrides.css +47 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/js/admin.js +360 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/js/theme.js +108 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/vendor/bootstrap/LICENSE +21 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/vendor/bootstrap/css/bootstrap.min.css +2 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/static/django_bootstrap6_admin/vendor/bootstrap/js/bootstrap.bundle.min.js +9 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/404.html +17 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/500.html +31 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/actions.html +40 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/app_index.html +43 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/app_list.html +59 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/auth/user/add_form.html +11 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/auth/user/change_password.html +105 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/base.html +220 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/base_site.html +19 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/change_form.html +124 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/change_form_object_tools.html +14 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/change_list.html +179 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/change_list_object_tools.html +10 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/change_list_results.html +42 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/color_theme_toggle.html +15 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/date_hierarchy.html +27 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/delete_confirmation.html +89 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/delete_selected_confirmation.html +81 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/edit_inline/stacked.html +67 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/edit_inline/tabular.html +94 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/filter.html +17 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/includes/fieldset.html +54 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/includes/object_delete_summary.html +7 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/index.html +136 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/login.html +99 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/nav_sidebar.html +21 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/object_history.html +81 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/pagination.html +18 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/search_form.html +28 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/submit_line.html +35 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/widgets/foreign_key_raw_id.html +14 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/admin/widgets/related_widget_wrapper.html +49 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/registration/logged_out.html +32 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/registration/password_change_done.html +30 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templates/registration/password_change_form.html +74 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templatetags/__init__.py +0 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin/templatetags/bootstrap6_admin.py +38 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin.egg-info/PKG-INFO +262 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin.egg-info/SOURCES.txt +69 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin.egg-info/dependency_links.txt +1 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin.egg-info/requires.txt +6 -0
- django_bootstrap6_admin-0.1.0/src/django_bootstrap6_admin.egg-info/top_level.txt +1 -0
- django_bootstrap6_admin-0.1.0/tests/__init__.py +0 -0
- django_bootstrap6_admin-0.1.0/tests/settings.py +70 -0
- django_bootstrap6_admin-0.1.0/tests/smoke_wheel.py +86 -0
- django_bootstrap6_admin-0.1.0/tests/test_admin_ui.py +283 -0
- django_bootstrap6_admin-0.1.0/tests/test_package.py +33 -0
- django_bootstrap6_admin-0.1.0/tests/test_templatetags.py +37 -0
- django_bootstrap6_admin-0.1.0/tests/testapp/__init__.py +0 -0
- django_bootstrap6_admin-0.1.0/tests/testapp/admin.py +52 -0
- django_bootstrap6_admin-0.1.0/tests/testapp/apps.py +7 -0
- django_bootstrap6_admin-0.1.0/tests/testapp/models.py +68 -0
- django_bootstrap6_admin-0.1.0/tests/urls.py +6 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Initial release of the Bootstrap 6 skin for the Django admin.
|
|
15
|
+
- Bootstrap 6 based dashboard, changelist, change form, login, logout and
|
|
16
|
+
password change pages.
|
|
17
|
+
- Collapsible desktop sidebar, mobile drawer navigation and keyboard support.
|
|
18
|
+
- Light, dark and system themes synchronised with Django's `theme`
|
|
19
|
+
localStorage preference.
|
|
20
|
+
- Bundled Bootstrap 6.0.0-alpha.1 assets and licence.
|
|
21
|
+
- Support for Django 6.1 on Python 3.12, 3.13 and 3.14.
|
|
22
|
+
- Test suite with a demo Django app and GitHub Actions CI.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for taking the time to improve `django-bootstrap6-admin`.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/asandikci/django-bootstrap6-admin.git
|
|
9
|
+
cd django-bootstrap6-admin
|
|
10
|
+
python -m venv .venv
|
|
11
|
+
source .venv/bin/activate
|
|
12
|
+
python -m pip install --upgrade pip
|
|
13
|
+
python -m pip install -e ".[dev]"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The test suite uses `tests/settings.py` and a small demo app in
|
|
17
|
+
`tests/testapp/`:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python -m django test --settings=tests.settings
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Run the linter and formatter check before opening a pull request:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ruff check .
|
|
27
|
+
ruff format --check .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Manual checks
|
|
31
|
+
|
|
32
|
+
The package only ships templates and static files, so visual changes should be
|
|
33
|
+
checked in a browser as well as in the test suite. A quick way to start a demo
|
|
34
|
+
server is to add a `urls.py` to the test settings and run:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python -m django runserver --settings=tests.settings
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The demo app is registered at `/admin/` by `tests/urls.py`. Create the
|
|
41
|
+
database and a superuser first:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m django migrate --settings=tests.settings
|
|
45
|
+
python -m django createsuperuser --settings=tests.settings
|
|
46
|
+
python -m django runserver --settings=tests.settings
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Packaging
|
|
50
|
+
|
|
51
|
+
Build and validate the distributions locally:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
python -m build
|
|
55
|
+
python -m twine check --strict dist/*
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The wheel must contain the admin templates, the bundled Bootstrap assets and
|
|
59
|
+
the licence files. The CI package job installs the wheel into a clean virtual
|
|
60
|
+
environment and compiles every bundled template as a smoke test.
|
|
61
|
+
|
|
62
|
+
## Release checklist
|
|
63
|
+
|
|
64
|
+
1. Update `__version__` in `src/django_bootstrap6_admin/__init__.py`.
|
|
65
|
+
2. Move the `Unreleased` entries in `CHANGELOG.md` into a new version section
|
|
66
|
+
with today's date.
|
|
67
|
+
3. Run the tests, lint and build checks locally.
|
|
68
|
+
4. Commit the release changes and push them to `main`.
|
|
69
|
+
5. Create and push an annotated tag:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
git tag -a v0.1.0 -m "django-bootstrap6-admin 0.1.0"
|
|
73
|
+
git push origin v0.1.0
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
6. The `Release` workflow builds the distributions, verifies that the tag
|
|
77
|
+
matches `__version__`, and publishes to PyPI.
|
|
78
|
+
|
|
79
|
+
### One-time PyPI Trusted Publishing setup
|
|
80
|
+
|
|
81
|
+
The workflow uses OpenID Connect, so no PyPI token is stored in GitHub.
|
|
82
|
+
|
|
83
|
+
1. Sign in to PyPI and open **Publishing** for the project.
|
|
84
|
+
2. Add a pending publisher with:
|
|
85
|
+
- **Owner:** `asandikci`
|
|
86
|
+
- **Repository:** `django-bootstrap6-admin`
|
|
87
|
+
- **Workflow:** `release.yml`
|
|
88
|
+
- **Environment:** `pypi`
|
|
89
|
+
3. In the GitHub repository, create an environment named `pypi` under
|
|
90
|
+
**Settings → Environments**. Add required reviewers or a deployment branch
|
|
91
|
+
rule if you want a manual approval before publishing.
|
|
92
|
+
|
|
93
|
+
If Trusted Publishing is not available yet, create a PyPI API token and add it
|
|
94
|
+
as the `PYPI_API_TOKEN` repository secret, then change the publish step to use
|
|
95
|
+
`password: ${{ secrets.PYPI_API_TOKEN }}`. Do not commit tokens to the
|
|
96
|
+
repository.
|
|
97
|
+
|
|
98
|
+
## Licence
|
|
99
|
+
|
|
100
|
+
By contributing, you agree that your contributions are licensed under the MIT
|
|
101
|
+
licence used by this project. The admin templates are derived from Django's
|
|
102
|
+
BSD-licensed templates; keep the attribution in `NOTICE` intact.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aliberk Sandıkçı
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include NOTICE
|
|
3
|
+
include README.md
|
|
4
|
+
include CHANGELOG.md
|
|
5
|
+
include CONTRIBUTING.md
|
|
6
|
+
recursive-include src/django_bootstrap6_admin/templates *.html
|
|
7
|
+
recursive-include src/django_bootstrap6_admin/static *
|
|
8
|
+
recursive-include tests *.py
|
|
9
|
+
global-exclude __pycache__
|
|
10
|
+
global-exclude *.py[cod]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
django-bootstrap6-admin
|
|
2
|
+
=======================
|
|
3
|
+
|
|
4
|
+
The admin templates and layout in this package are derived from Django's
|
|
5
|
+
administration templates.
|
|
6
|
+
|
|
7
|
+
Django
|
|
8
|
+
------
|
|
9
|
+
|
|
10
|
+
Copyright (c) Django Software Foundation and individual contributors.
|
|
11
|
+
All rights reserved.
|
|
12
|
+
|
|
13
|
+
Redistribution and use in source and binary forms, with or without
|
|
14
|
+
modification, are permitted provided that the following conditions are met:
|
|
15
|
+
|
|
16
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
17
|
+
this list of conditions and the following disclaimer.
|
|
18
|
+
|
|
19
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
20
|
+
this list of conditions and the following disclaimer in the documentation
|
|
21
|
+
and/or other materials provided with the distribution.
|
|
22
|
+
|
|
23
|
+
3. Neither the name of Django nor the names of its contributors may be used
|
|
24
|
+
to endorse or promote products derived from this software without specific
|
|
25
|
+
prior written permission.
|
|
26
|
+
|
|
27
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
28
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
29
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
30
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
31
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
32
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
33
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
34
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
35
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
36
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37
|
+
|
|
38
|
+
Source: https://github.com/django/django/blob/main/LICENSE
|
|
39
|
+
|
|
40
|
+
Bootstrap
|
|
41
|
+
---------
|
|
42
|
+
|
|
43
|
+
Copyright (c) 2011-2026 The Bootstrap Authors.
|
|
44
|
+
Licensed under the MIT License.
|
|
45
|
+
|
|
46
|
+
The bundled license text is at
|
|
47
|
+
`static/django_bootstrap6_admin/vendor/bootstrap/LICENSE`.
|
|
48
|
+
Source: https://github.com/twbs/bootstrap/blob/main/LICENSE
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-bootstrap6-admin
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A modern Bootstrap 6 skin for the Django admin.
|
|
5
|
+
Author-email: Aliberk Sandıkçı <git@asandikci.com>
|
|
6
|
+
Maintainer-email: Aliberk Sandıkçı <git@asandikci.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/asandikci/django-bootstrap6-admin
|
|
9
|
+
Project-URL: Repository, https://github.com/asandikci/django-bootstrap6-admin
|
|
10
|
+
Project-URL: Issues, https://github.com/asandikci/django-bootstrap6-admin/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/asandikci/django-bootstrap6-admin/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: django,admin,bootstrap,bootstrap6,theme
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Web Environment
|
|
15
|
+
Classifier: Framework :: Django
|
|
16
|
+
Classifier: Framework :: Django :: 6.1
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
26
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
27
|
+
Requires-Python: >=3.12
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
License-File: NOTICE
|
|
31
|
+
Requires-Dist: Django<6.2,>=6.1
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
34
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
35
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# django-bootstrap6-admin
|
|
39
|
+
|
|
40
|
+
[](https://github.com/asandikci/django-bootstrap6-admin/actions/workflows/ci.yml)
|
|
41
|
+
[](https://pypi.org/project/django-bootstrap6-admin/)
|
|
42
|
+
[](https://pypi.org/project/django-bootstrap6-admin/)
|
|
43
|
+
[](https://www.djangoproject.com/)
|
|
44
|
+
[](LICENSE)
|
|
45
|
+
|
|
46
|
+
A modern, responsive Bootstrap 6 skin for the Django admin. It replaces the
|
|
47
|
+
default admin templates and static assets without monkey-patching Django,
|
|
48
|
+
changing admin classes, adding database queries, or requiring migrations.
|
|
49
|
+
|
|
50
|
+
The package is a thin presentation layer: Django's admin views, forms,
|
|
51
|
+
permissions and JavaScript remain in charge.
|
|
52
|
+
|
|
53
|
+
## Features
|
|
54
|
+
|
|
55
|
+
- Bootstrap 6 markup and design tokens throughout the admin.
|
|
56
|
+
- Sticky top bar with a collapsible sidebar (desktop) and drawer navigation
|
|
57
|
+
with a backdrop (mobile).
|
|
58
|
+
- Dashboard with application cards, model shortcuts and recent activity.
|
|
59
|
+
- Changelist with search, date hierarchy, collapsible filters, sortable
|
|
60
|
+
headers, bulk actions and Bootstrap pagination.
|
|
61
|
+
- Change form with card-based fieldsets, collapsible sections, a clear save
|
|
62
|
+
bar, tabular/stacked inlines and related-object popups.
|
|
63
|
+
- Modern login, logout and password change pages.
|
|
64
|
+
- Light, dark and system themes. The existing Django `theme` localStorage
|
|
65
|
+
preference is synchronised with Bootstrap's `data-bs-theme` attribute.
|
|
66
|
+
- Accessible focus states, labels, table headers and ARIA attributes.
|
|
67
|
+
- All Django admin JavaScript hooks are preserved: `actions.js`,
|
|
68
|
+
`filters.js`, `nav_sidebar.js`, inlines, Select2/autocomplete, calendar
|
|
69
|
+
widgets and related-object lookups.
|
|
70
|
+
- CSP-aware: bundled scripts and styles use Django 6.1's
|
|
71
|
+
`{% csp_nonce_attr %}` tag, so nonce-based policies work out of the box.
|
|
72
|
+
- Generic by design: no models, no migrations, no project-specific imports and
|
|
73
|
+
no assumptions about the host project's branding. The default navy/gold
|
|
74
|
+
palette is only a set of overridable CSS variables.
|
|
75
|
+
|
|
76
|
+
## Requirements
|
|
77
|
+
|
|
78
|
+
| Component | Supported versions |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| Python | 3.12, 3.13, 3.14 |
|
|
81
|
+
| Django | 6.1.x |
|
|
82
|
+
| Bootstrap | 6.0.0-alpha.1 (bundled) |
|
|
83
|
+
|
|
84
|
+
Django 6.1 is required because the templates use the
|
|
85
|
+
`{% csp_nonce_attr %}` template tag and the change-form admin actions added in
|
|
86
|
+
that release. Django 5.2 LTS and 6.0 are not supported by this version.
|
|
87
|
+
|
|
88
|
+
## Installation
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install django-bootstrap6-admin
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Add the app **before** `django.contrib.admin` so its `admin/` templates take
|
|
95
|
+
precedence:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
INSTALLED_APPS = [
|
|
99
|
+
"django_bootstrap6_admin",
|
|
100
|
+
"django.contrib.admin",
|
|
101
|
+
"django.contrib.auth",
|
|
102
|
+
"django.contrib.contenttypes",
|
|
103
|
+
"django.contrib.sessions",
|
|
104
|
+
"django.contrib.messages",
|
|
105
|
+
"django.contrib.staticfiles",
|
|
106
|
+
# ...
|
|
107
|
+
]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
That's it. There are no settings to add, no migrations and no URL changes.
|
|
111
|
+
|
|
112
|
+
For a local checkout:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git clone https://github.com/asandikci/django-bootstrap6-admin.git
|
|
116
|
+
cd django-bootstrap6-admin
|
|
117
|
+
python -m pip install -e .
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## What gets overridden
|
|
121
|
+
|
|
122
|
+
The app provides templates for the standard Django admin pages, including:
|
|
123
|
+
|
|
124
|
+
- `admin/base.html`, `base_site.html`, `index.html`, `app_list.html`
|
|
125
|
+
- `admin/change_list.html`, `change_form.html`, `delete_confirmation.html`
|
|
126
|
+
- `admin/edit_inline/stacked.html`, `edit_inline/tabular.html`
|
|
127
|
+
- `admin/login.html`, `admin/object_history.html`
|
|
128
|
+
- `admin/auth/user/add_form.html`, `admin/auth/user/change_password.html`
|
|
129
|
+
- `registration/logged_out.html`, `registration/password_change_form.html`
|
|
130
|
+
and `registration/password_change_done.html`
|
|
131
|
+
|
|
132
|
+
Only the three auth templates used directly by the admin site are shipped.
|
|
133
|
+
They still live in Django's global `registration/` namespace, so they also
|
|
134
|
+
apply to those views if a project uses them outside the admin; override them
|
|
135
|
+
if you need separate public-site auth screens. Password reset templates are
|
|
136
|
+
intentionally left to the host project, because reset URLs and their branding
|
|
137
|
+
usually belong to the public site rather than to the admin package.
|
|
138
|
+
|
|
139
|
+
## Customisation
|
|
140
|
+
|
|
141
|
+
### Long change forms
|
|
142
|
+
|
|
143
|
+
The action bar sits at the end of the form by default. For long forms, enable
|
|
144
|
+
Django's standard top action bar on a `ModelAdmin`:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
class BookAdmin(admin.ModelAdmin):
|
|
148
|
+
save_on_top = True
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Branding
|
|
152
|
+
|
|
153
|
+
Use Django's existing admin site settings:
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
from django.contrib import admin
|
|
157
|
+
|
|
158
|
+
admin.site.site_header = "Acme administration"
|
|
159
|
+
admin.site.site_title = "Acme"
|
|
160
|
+
admin.site.index_title = "Operations"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Templates
|
|
164
|
+
|
|
165
|
+
Every block from Django's admin base templates is preserved. Override any
|
|
166
|
+
template normally, for example `templates/admin/base_site.html`, or extend the
|
|
167
|
+
provided template:
|
|
168
|
+
|
|
169
|
+
```django
|
|
170
|
+
{% extends "admin/base_site.html" %}
|
|
171
|
+
|
|
172
|
+
{% block branding %}
|
|
173
|
+
{{ block.super }}
|
|
174
|
+
<span class="badge badge-subtle theme-info">Internal</span>
|
|
175
|
+
{% endblock %}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Colours
|
|
179
|
+
|
|
180
|
+
The skin uses Bootstrap 6 design tokens (`--bs-*`) and a small set of
|
|
181
|
+
`--ba-*` variables. Override them after the admin stylesheet, for example in a
|
|
182
|
+
custom admin CSS file:
|
|
183
|
+
|
|
184
|
+
```css
|
|
185
|
+
:root {
|
|
186
|
+
--ba-topbar-bg: #1f2937;
|
|
187
|
+
--ba-gold: #f59e0b;
|
|
188
|
+
--ba-sidebar-width: 300px;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The default primary and danger colours are deliberately deeper than Bootstrap
|
|
193
|
+
6's defaults so white button text meets WCAG AA contrast.
|
|
194
|
+
|
|
195
|
+
The select controls use small `data:` SVG arrows. If you enable a strict CSP,
|
|
196
|
+
allow `img-src 'self' data:` (or replace the arrows in your own CSS).
|
|
197
|
+
|
|
198
|
+
### Turning it off
|
|
199
|
+
|
|
200
|
+
Remove `django_bootstrap6_admin` from `INSTALLED_APPS` (or move it after
|
|
201
|
+
`django.contrib.admin`) and the default Django admin returns immediately.
|
|
202
|
+
There is no runtime state to clean up.
|
|
203
|
+
|
|
204
|
+
## How it works
|
|
205
|
+
|
|
206
|
+
- The app only contributes templates and static files.
|
|
207
|
+
- Django's admin views and forms are untouched.
|
|
208
|
+
- Django's own JavaScript remains the source of truth for the sidebar state,
|
|
209
|
+
filters, bulk actions and inlines.
|
|
210
|
+
- The bundled `theme.js` reads and writes Django's `theme` localStorage key and
|
|
211
|
+
mirrors it to `data-bs-theme`; it does not replace Django's admin behaviour.
|
|
212
|
+
- Bootstrap 6 is pinned as `6.0.0-alpha.1` in
|
|
213
|
+
`static/django_bootstrap6_admin/vendor/bootstrap/` to keep the visual result
|
|
214
|
+
stable. Its MIT licence is included next to the assets. SHA-256 of the
|
|
215
|
+
bundled files:
|
|
216
|
+
- `bootstrap.min.css`:
|
|
217
|
+
`678508b198d9b1b8877e338f419fdada00024be2bcc638a539dd724856095112`
|
|
218
|
+
- `bootstrap.bundle.min.js`:
|
|
219
|
+
`47ea447f46e288dd9d3e83147b7ba539c6df5192c047b8f91739cd56a5721148`
|
|
220
|
+
|
|
221
|
+
## Development
|
|
222
|
+
|
|
223
|
+
The test suite uses an isolated settings module and a small demo app. Create a
|
|
224
|
+
virtual environment and install the package in editable mode:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
python -m venv .venv
|
|
228
|
+
source .venv/bin/activate
|
|
229
|
+
python -m pip install --upgrade pip
|
|
230
|
+
python -m pip install -e ".[dev]"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Run the tests and the linter:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
python -m django test --settings=tests.settings
|
|
237
|
+
ruff check .
|
|
238
|
+
ruff format --check .
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Build and validate the distribution:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
python -m build
|
|
245
|
+
python -m twine check --strict dist/*
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The same checks run in GitHub Actions on Python 3.12, 3.13 and 3.14.
|
|
249
|
+
|
|
250
|
+
## Releasing
|
|
251
|
+
|
|
252
|
+
Releases are published from a `v*` tag with PyPI Trusted Publishing. See
|
|
253
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) for the complete release checklist and the
|
|
254
|
+
one-time PyPI publisher setup.
|
|
255
|
+
|
|
256
|
+
## Licence
|
|
257
|
+
|
|
258
|
+
MIT. The admin templates are derived from Django's BSD-licensed admin
|
|
259
|
+
templates, and Bootstrap is distributed under the MIT licence. See
|
|
260
|
+
[NOTICE](NOTICE) and
|
|
261
|
+
`static/django_bootstrap6_admin/vendor/bootstrap/LICENSE` for the full
|
|
262
|
+
attribution and licence texts.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# django-bootstrap6-admin
|
|
2
|
+
|
|
3
|
+
[](https://github.com/asandikci/django-bootstrap6-admin/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/django-bootstrap6-admin/)
|
|
5
|
+
[](https://pypi.org/project/django-bootstrap6-admin/)
|
|
6
|
+
[](https://www.djangoproject.com/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
A modern, responsive Bootstrap 6 skin for the Django admin. It replaces the
|
|
10
|
+
default admin templates and static assets without monkey-patching Django,
|
|
11
|
+
changing admin classes, adding database queries, or requiring migrations.
|
|
12
|
+
|
|
13
|
+
The package is a thin presentation layer: Django's admin views, forms,
|
|
14
|
+
permissions and JavaScript remain in charge.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Bootstrap 6 markup and design tokens throughout the admin.
|
|
19
|
+
- Sticky top bar with a collapsible sidebar (desktop) and drawer navigation
|
|
20
|
+
with a backdrop (mobile).
|
|
21
|
+
- Dashboard with application cards, model shortcuts and recent activity.
|
|
22
|
+
- Changelist with search, date hierarchy, collapsible filters, sortable
|
|
23
|
+
headers, bulk actions and Bootstrap pagination.
|
|
24
|
+
- Change form with card-based fieldsets, collapsible sections, a clear save
|
|
25
|
+
bar, tabular/stacked inlines and related-object popups.
|
|
26
|
+
- Modern login, logout and password change pages.
|
|
27
|
+
- Light, dark and system themes. The existing Django `theme` localStorage
|
|
28
|
+
preference is synchronised with Bootstrap's `data-bs-theme` attribute.
|
|
29
|
+
- Accessible focus states, labels, table headers and ARIA attributes.
|
|
30
|
+
- All Django admin JavaScript hooks are preserved: `actions.js`,
|
|
31
|
+
`filters.js`, `nav_sidebar.js`, inlines, Select2/autocomplete, calendar
|
|
32
|
+
widgets and related-object lookups.
|
|
33
|
+
- CSP-aware: bundled scripts and styles use Django 6.1's
|
|
34
|
+
`{% csp_nonce_attr %}` tag, so nonce-based policies work out of the box.
|
|
35
|
+
- Generic by design: no models, no migrations, no project-specific imports and
|
|
36
|
+
no assumptions about the host project's branding. The default navy/gold
|
|
37
|
+
palette is only a set of overridable CSS variables.
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
| Component | Supported versions |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| Python | 3.12, 3.13, 3.14 |
|
|
44
|
+
| Django | 6.1.x |
|
|
45
|
+
| Bootstrap | 6.0.0-alpha.1 (bundled) |
|
|
46
|
+
|
|
47
|
+
Django 6.1 is required because the templates use the
|
|
48
|
+
`{% csp_nonce_attr %}` template tag and the change-form admin actions added in
|
|
49
|
+
that release. Django 5.2 LTS and 6.0 are not supported by this version.
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install django-bootstrap6-admin
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add the app **before** `django.contrib.admin` so its `admin/` templates take
|
|
58
|
+
precedence:
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
INSTALLED_APPS = [
|
|
62
|
+
"django_bootstrap6_admin",
|
|
63
|
+
"django.contrib.admin",
|
|
64
|
+
"django.contrib.auth",
|
|
65
|
+
"django.contrib.contenttypes",
|
|
66
|
+
"django.contrib.sessions",
|
|
67
|
+
"django.contrib.messages",
|
|
68
|
+
"django.contrib.staticfiles",
|
|
69
|
+
# ...
|
|
70
|
+
]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
That's it. There are no settings to add, no migrations and no URL changes.
|
|
74
|
+
|
|
75
|
+
For a local checkout:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
git clone https://github.com/asandikci/django-bootstrap6-admin.git
|
|
79
|
+
cd django-bootstrap6-admin
|
|
80
|
+
python -m pip install -e .
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## What gets overridden
|
|
84
|
+
|
|
85
|
+
The app provides templates for the standard Django admin pages, including:
|
|
86
|
+
|
|
87
|
+
- `admin/base.html`, `base_site.html`, `index.html`, `app_list.html`
|
|
88
|
+
- `admin/change_list.html`, `change_form.html`, `delete_confirmation.html`
|
|
89
|
+
- `admin/edit_inline/stacked.html`, `edit_inline/tabular.html`
|
|
90
|
+
- `admin/login.html`, `admin/object_history.html`
|
|
91
|
+
- `admin/auth/user/add_form.html`, `admin/auth/user/change_password.html`
|
|
92
|
+
- `registration/logged_out.html`, `registration/password_change_form.html`
|
|
93
|
+
and `registration/password_change_done.html`
|
|
94
|
+
|
|
95
|
+
Only the three auth templates used directly by the admin site are shipped.
|
|
96
|
+
They still live in Django's global `registration/` namespace, so they also
|
|
97
|
+
apply to those views if a project uses them outside the admin; override them
|
|
98
|
+
if you need separate public-site auth screens. Password reset templates are
|
|
99
|
+
intentionally left to the host project, because reset URLs and their branding
|
|
100
|
+
usually belong to the public site rather than to the admin package.
|
|
101
|
+
|
|
102
|
+
## Customisation
|
|
103
|
+
|
|
104
|
+
### Long change forms
|
|
105
|
+
|
|
106
|
+
The action bar sits at the end of the form by default. For long forms, enable
|
|
107
|
+
Django's standard top action bar on a `ModelAdmin`:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
class BookAdmin(admin.ModelAdmin):
|
|
111
|
+
save_on_top = True
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Branding
|
|
115
|
+
|
|
116
|
+
Use Django's existing admin site settings:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from django.contrib import admin
|
|
120
|
+
|
|
121
|
+
admin.site.site_header = "Acme administration"
|
|
122
|
+
admin.site.site_title = "Acme"
|
|
123
|
+
admin.site.index_title = "Operations"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Templates
|
|
127
|
+
|
|
128
|
+
Every block from Django's admin base templates is preserved. Override any
|
|
129
|
+
template normally, for example `templates/admin/base_site.html`, or extend the
|
|
130
|
+
provided template:
|
|
131
|
+
|
|
132
|
+
```django
|
|
133
|
+
{% extends "admin/base_site.html" %}
|
|
134
|
+
|
|
135
|
+
{% block branding %}
|
|
136
|
+
{{ block.super }}
|
|
137
|
+
<span class="badge badge-subtle theme-info">Internal</span>
|
|
138
|
+
{% endblock %}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Colours
|
|
142
|
+
|
|
143
|
+
The skin uses Bootstrap 6 design tokens (`--bs-*`) and a small set of
|
|
144
|
+
`--ba-*` variables. Override them after the admin stylesheet, for example in a
|
|
145
|
+
custom admin CSS file:
|
|
146
|
+
|
|
147
|
+
```css
|
|
148
|
+
:root {
|
|
149
|
+
--ba-topbar-bg: #1f2937;
|
|
150
|
+
--ba-gold: #f59e0b;
|
|
151
|
+
--ba-sidebar-width: 300px;
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The default primary and danger colours are deliberately deeper than Bootstrap
|
|
156
|
+
6's defaults so white button text meets WCAG AA contrast.
|
|
157
|
+
|
|
158
|
+
The select controls use small `data:` SVG arrows. If you enable a strict CSP,
|
|
159
|
+
allow `img-src 'self' data:` (or replace the arrows in your own CSS).
|
|
160
|
+
|
|
161
|
+
### Turning it off
|
|
162
|
+
|
|
163
|
+
Remove `django_bootstrap6_admin` from `INSTALLED_APPS` (or move it after
|
|
164
|
+
`django.contrib.admin`) and the default Django admin returns immediately.
|
|
165
|
+
There is no runtime state to clean up.
|
|
166
|
+
|
|
167
|
+
## How it works
|
|
168
|
+
|
|
169
|
+
- The app only contributes templates and static files.
|
|
170
|
+
- Django's admin views and forms are untouched.
|
|
171
|
+
- Django's own JavaScript remains the source of truth for the sidebar state,
|
|
172
|
+
filters, bulk actions and inlines.
|
|
173
|
+
- The bundled `theme.js` reads and writes Django's `theme` localStorage key and
|
|
174
|
+
mirrors it to `data-bs-theme`; it does not replace Django's admin behaviour.
|
|
175
|
+
- Bootstrap 6 is pinned as `6.0.0-alpha.1` in
|
|
176
|
+
`static/django_bootstrap6_admin/vendor/bootstrap/` to keep the visual result
|
|
177
|
+
stable. Its MIT licence is included next to the assets. SHA-256 of the
|
|
178
|
+
bundled files:
|
|
179
|
+
- `bootstrap.min.css`:
|
|
180
|
+
`678508b198d9b1b8877e338f419fdada00024be2bcc638a539dd724856095112`
|
|
181
|
+
- `bootstrap.bundle.min.js`:
|
|
182
|
+
`47ea447f46e288dd9d3e83147b7ba539c6df5192c047b8f91739cd56a5721148`
|
|
183
|
+
|
|
184
|
+
## Development
|
|
185
|
+
|
|
186
|
+
The test suite uses an isolated settings module and a small demo app. Create a
|
|
187
|
+
virtual environment and install the package in editable mode:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
python -m venv .venv
|
|
191
|
+
source .venv/bin/activate
|
|
192
|
+
python -m pip install --upgrade pip
|
|
193
|
+
python -m pip install -e ".[dev]"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Run the tests and the linter:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
python -m django test --settings=tests.settings
|
|
200
|
+
ruff check .
|
|
201
|
+
ruff format --check .
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Build and validate the distribution:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
python -m build
|
|
208
|
+
python -m twine check --strict dist/*
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The same checks run in GitHub Actions on Python 3.12, 3.13 and 3.14.
|
|
212
|
+
|
|
213
|
+
## Releasing
|
|
214
|
+
|
|
215
|
+
Releases are published from a `v*` tag with PyPI Trusted Publishing. See
|
|
216
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) for the complete release checklist and the
|
|
217
|
+
one-time PyPI publisher setup.
|
|
218
|
+
|
|
219
|
+
## Licence
|
|
220
|
+
|
|
221
|
+
MIT. The admin templates are derived from Django's BSD-licensed admin
|
|
222
|
+
templates, and Bootstrap is distributed under the MIT licence. See
|
|
223
|
+
[NOTICE](NOTICE) and
|
|
224
|
+
`static/django_bootstrap6_admin/vendor/bootstrap/LICENSE` for the full
|
|
225
|
+
attribution and licence texts.
|