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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 67.6MB
glibcpy 3.10–3.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`.fixFor 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.fixIf 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.fixEnsure `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.fixCarefully 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.