django-bootstrap4
Bootstrap 4 for Django
What it is and what it does
django-bootstrap4 is a Django template library that bridges Django forms and Bootstrap 4 styling. It provides template tags and filters that automatically render Django form fields, buttons, and other UI elements as properly styled Bootstrap 4 HTML, eliminating the need to manually write Bootstrap markup in your templates.
The package is currently in maintenance mode because Bootstrap 4 has been superseded by Bootstrap 5. This means it will receive bug fixes and security updates but no new features. It depends on django and beautifulsoup4, and requires Python 3.10 or later with a currently supported Django version. The package is straightforward to install and integrate into existing Django projects via a single INSTALLED_APPS entry.
Use it for:
- Quickly style Django forms with Bootstrap 4 classes without writing custom HTML for each field.
- Build admin-like interfaces where form rendering consistency matters and Bootstrap 4 is your CSS framework.
- Migrate a legacy Django project to Bootstrap 4 by replacing manual form markup with template tags.
- Render Bootstrap 4 buttons, alerts, and other components from Django templates using provided tags.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Django template tags and filters to render Bootstrap 4 HTML components and forms with minimal markup.
Yes, if you are maintaining an existing Django + Bootstrap 4 project or building a new one that must use Bootstrap 4. The package is stable, actively receives security and bug fixes, and has low install friction. No, if you are starting a new project—use django-bootstrap5 instead, as Bootstrap 4 is superseded and this package will not gain new features.
Install
django-bootstrap4 on PyPI
pip
pip install django-bootstrap4uv
uv add django-bootstrap4poetry
poetry add django-bootstrap4Installing django-bootstrap4
Before you install
Low friction install with two straightforward runtime dependencies (django and beautifulsoup4). Actively maintained with recent commits and receiving bug fixes and security updates despite being in maintenance mode for Bootstrap 4.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install django-bootstrap4
# In settings.py, add to INSTALLED_APPS:
INSTALLED_APPS = (
'bootstrap4',
)
# In your template:
{% load bootstrap4 %}
{% bootstrap_form form %}
{% buttons %}Submit{% endbuttons %}
Requires Python 3.10 or later and a supported Django version (4.2, 5.2, or 6.0).
Verify before relying
- Whether Bootstrap 4 EOL status affects long-term security or feature compatibility for new projects.
- Specific migration path and effort required to upgrade existing projects from Bootstrap 4 to Bootstrap 5.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — django, beautifulsoup4 |
| Maintenance | actively maintained — 223 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 401,585/month — #6,926 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_bootstrap4-26.1-py3-none-any.whl
Keywords: django, bootstrap, bootstrap4
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
django-bootstrap3Provides Django template tags and filters to…
permissive · top 15,000 on PyPI
django-bootstrap5Provides Django template tags and filters to…
permissive · top 15,000 on PyPI
Bootstrap-FlaskBootstrap-Flask provides Jinja macros that…
permissive · top 15,000 on PyPI
crispy-bootstrap4Provides Bootstrap 4 HTML templates for…
permissive · top 15,000 on PyPI
django-bootstrap-formRenders Django form fields as Bootstrap-styled…
permissive · top 15,000 on PyPI
crispy-bootstrap3Provides Bootstrap 3 HTML templates for…
permissive · top 15,000 on PyPI
crispy-bootstrap5Provides Bootstrap 5 form templates and layout…
permissive · top 5,000 on PyPI
django-bootstrap-datepicker-plusProvides Bootstrap-styled date, time, and…
permissive · top 15,000 on PyPI
django-crispy-formsRenders Django forms programmatically with full…
permissive · top 5,000 on PyPI
Flask-BootstrapFlask-Bootstrap packages Bootstrap CSS and…
permissive · top 15,000 on PyPI