Registry / web-framework / django-bootstrap4

django-bootstrap4

JSON →
library26.1pypypiunverified

django-bootstrap4 seamlessly integrates Bootstrap 4 into Django projects, providing template tags and filters for easy rendering of Bootstrap components. As of version 26.1, the library is in maintenance mode, receiving only bug fixes and security updates. This is due to Bootstrap 4 being superseded by Bootstrap 5, and new projects are encouraged to use the dedicated `django-bootstrap5` package.

pip install django-bootstrap4
INSTALL
IMPORT
SIG · DJANGO-BOOTSTRAP4
D
django-bootstrap4
web-frameworkpythonv26.1
Install
3.7s avg
Import
Disk
67MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v26.1 · 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 · 67.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.7s · import 0.000s · 68MB
67MB installed
● package 67MB
Code
Verified usage

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

bootstrap4 template tags
{% load bootstrap4 %}
{% load bootstrap_tags %}
Older versions or forks sometimes used 'bootstrap_tags', but 'bootstrap4' is the correct and current template tag library name for this package.

After installing, add 'bootstrap4' to `INSTALLED_APPS` in your Django `settings.py`. In your templates, load the `bootstrap4` template tag library and use `{% bootstrap_css %}` and `{% bootstrap_javascript %}` to include Bootstrap's assets. Forms can be easily rendered using `{% bootstrap_form form %}`.

# settings.py INSTALLED_APPS = [ # ... 'bootstrap4', # ... ] # templates/base.html (or any template using Bootstrap) {% load bootstrap4 %} <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> {% bootstrap_css %} <title>My Django App</title> </head> <body> <div class="container"> <h1>Hello, Bootstrap 4!</h1> <form method="post"> {% csrf_token %} {% bootstrap_form form %} {% buttons %} <button type="submit" class="btn btn-primary">Submit</button> {% endbuttons %} </form> </div> {% bootstrap_javascript %} </body> </html>
Debug
Known issues
breakingThe library is in maintenance mode. No new features will be added, only bug fixes and security updates. For new projects, consider using `django-bootstrap5`.
fix
For new projects, start with `django-bootstrap5`. For existing projects, plan for eventual migration to Bootstrap 5 or accept limited future enhancements.
affects: All versions from 21.1 (Nov 2021) onwards.
breakingBootstrap 4 (and thus django-bootstrap4) does not include an icon set by default, unlike Bootstrap 3. The `bootstrap_icon` template tag was removed.
fix
If icons are needed, integrate a separate icon library like Font Awesome or use `django-icons` in conjunction with `django-bootstrap4`.
affects: All versions.
gotchaStatic assets (CSS, JavaScript) may not load in production environments (`DEBUG=False`) if Django's static files are not properly configured and collected.
fix
Ensure `STATIC_ROOT` is defined in `settings.py`, and run `python manage.py collectstatic` on your deployment server. Verify your web server is configured to serve files from `STATIC_ROOT`.
affects: All versions.
breakingMigrating from `django-bootstrap3` or a Bootstrap 3 project to `django-bootstrap4` is not fully backwards compatible and requires referring to the official Bootstrap 3 to 4 migration guide for client-side changes.
fix
Carefully review the official Bootstrap migration guide for changes in classes, components, and JavaScript behavior. Update templates and custom CSS accordingly.
affects: Versions 1.0.0+ (when Bootstrap 4 was introduced).
Upgrade
Version history
26.1latest on PyPI · released Jan 3, 2026
Audit
Dependencies
DjangorequiredFramework integration. Supports currently maintained Django versions (e.g., 4.x, 5.x, 6.x for latest django-bootstrap4).
PythonrequiredRuntime environment.
Agent activity
50 hits · last 30 days
node
44
Amazon
1
OpenAI (training)
1
Resources
django-bootstrap4 — pip install django-bootstrap4 · libregistry