Registry / web-framework / django-bootstrap5

django-bootstrap5

JSON →
library26.2pypypiunverified

django-bootstrap5 is a Django app that provides Bootstrap 5 integration for Django projects, offering a collection of template tags and filters to seamlessly blend Django forms, messages, and other components with Bootstrap 5. It is actively maintained and considered production-ready, with frequent releases to keep up with Bootstrap and Django updates.

pip install django-bootstrap5
INSTALL
IMPORT
SIG · DJANGO-BOOTSTRAP5
D
django-bootstrap5
web-frameworkpythonv26.2
Install
3.4s avg
Import
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v26.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.4s · import 0.000s · 67MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

django_bootstrap5
INSTALLED_APPS = ( # ... "django_bootstrap5", # ... )
INSTALLED_APPS = ( # ... "bootstrap5", # ... )
The correct app name for `django-bootstrap5` in `INSTALLED_APPS` is `django_bootstrap5`. Using `bootstrap5` is a common mistake, often due to confusion with the older `django-bootstrap-v5` package.
load django_bootstrap5
{% load django_bootstrap5 %}
{% load bootstrap5 %}
When loading template tags, use `{% load django_bootstrap5 %}`. `{% load bootstrap5 %}` refers to a different, potentially unmaintained, package or an older version.

After installation, add `django_bootstrap5` to your `INSTALLED_APPS`. In your Django templates, load the `django_bootstrap5` library using `{% load django_bootstrap5 %}`. Include `{% bootstrap_css %}` in your `<head>` and `{% bootstrap_javascript %}` before the closing `</body>` tag to load Bootstrap's CSS and JS. You can then use template tags like `{% bootstrap_form form %}` to render forms easily.

# settings.py INSTALLED_APPS = [ # ... 'django.contrib.staticfiles', 'django_bootstrap5', # ... ] # myapp/templates/myapp/base.html (or any template using Bootstrap) {% load django_bootstrap5 %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Django App</title> {% bootstrap_css %} </head> <body> <div class="container"> <h1>Hello Bootstrap 5!</h1> <form method="post" class="form"> {% csrf_token %} {% bootstrap_form form %} {% bootstrap_button button_type="submit" content="Submit" %} </form> </div> {% bootstrap_javascript %} </body> </html>
Debug
Known issues
breakingWhen migrating from `django-bootstrap4`, you must update all references from `bootstrap4` to `django_bootstrap5`. This includes `INSTALLED_APPS`, `{% load ... %}` tags in templates, and any template inheritance.
fix
Replace `bootstrap4` with `django_bootstrap5` in `settings.py` (INSTALLED_APPS), template `{% load %}` statements, and `{% extends %}` statements.
affects: All versions migrating from `django-bootstrap4`
breakingBootstrap 5 explicitly dropped jQuery support, and consequently, `django-bootstrap5` has removed all jQuery-related functions and tags. If your project still relies on jQuery for other purposes, you must include it manually; `{% bootstrap_javascript %}` will no longer provide it.
fix
Manually add jQuery `<script>` tags to your templates if your project requires jQuery.
affects: All versions
gotchaThere is a separate, often less maintained, package called `django-bootstrap-v5` which uses `bootstrap5` as its `INSTALLED_APPS` entry and template tag load name. Ensure you are consistently using `django-bootstrap5` and its corresponding `django_bootstrap5` names to avoid conflicts and unexpected behavior.
fix
Always use `django_bootstrap5` in `INSTALLED_APPS` and `{% load django_bootstrap5 %}` for this library. If switching, fully remove the other package and its references.
affects: All versions
gotchaSome template tags and settings from older `django-bootstrap` versions (e.g., `bootstrap4`) may have been removed or renamed in `django-bootstrap5` due to Bootstrap 5 API changes. Examples include removal of `InlineFieldRenderer` and simplification of size parameters.
fix
Consult the migration guide in the official documentation for a comprehensive list of changes. Update your templates and settings accordingly.
affects: All versions migrating from `django-bootstrap4`
Upgrade
Version history
26.2latest on PyPI · released Feb 8, 2026
Audit
Dependencies
DjangorequiredCore framework integration; supports Django >=3.2 (and newer actively supported versions like 6.0).
PythonrequiredRuntime environment; requires Python >=3.10.
Agent activity
12 hits · last 30 days
node
12
Resources
django-bootstrap5 — pip install django-bootstrap5 · libregistry