Registry / web-framework / django-bootstrap3

django-bootstrap3

JSON →
library26.1pypypiunverified

django-bootstrap3 is a Python library that integrates Bootstrap version 3 into Django projects. It provides template tags and filters to render forms, messages, and other Bootstrap components easily within Django templates. The current version is 26.1, and it maintains a steady release cadence.

pip install django-bootstrap3
INSTALL
IMPORT
SIG · DJANGO-BOOTSTRAP3
D
django-bootstrap3
web-frameworkpythonv26.1
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.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 · 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.

add_css_classes
from bootstrap3.utils import add_css_classes
from bootstrap3.utils import add_css_classes

To use `django-bootstrap3`, first install it with `pip install django-bootstrap3`. Then, add `'bootstrap3'` to your `INSTALLED_APPS` in `settings.py`. In any Django template where you want to use Bootstrap 3, include `{% load bootstrap3 %}` at the top, and then use tags like `{% bootstrap_css %}`, `{% bootstrap_javascript %}`, `{% bootstrap_messages %}`, and `{% bootstrap_form form %}`. This example demonstrates rendering a form passed as `form` in the template context.

{% load bootstrap3 %} <!DOCTYPE html> <html> <head> <title>Django Bootstrap3 Example</title> {% bootstrap_css %} {% bootstrap_javascript %} <style> .container { margin-top: 20px; } </style> </head> <body> <div class="container"> <h1>Contact Us</h1> {% bootstrap_messages %} <form action="" method="post" class="form"> {% csrf_token %} {% bootstrap_form form layout='horizontal' %} {% buttons submit='Submit' %} <button type="submit" class="btn btn-primary"> <span class="glyphicon glyphicon-envelope"></span> Submit </button> {% endbuttons %} </form> </div> </body> </html>
Debug
Known issues
breakingThis library is exclusively for Bootstrap 3, which is an end-of-life (EOL) framework and no longer receives official updates or security patches. Using it in new projects or expecting compatibility with modern Bootstrap versions (4 or 5) is highly discouraged and will lead to broken layouts and potential security vulnerabilities.
fix
For new projects or projects requiring modern Bootstrap features, use `django-bootstrap4` or `django-bootstrap5` instead. If you must use Bootstrap 3, be fully aware of its EOL status and associated risks.
affects: All versions
gotchaForgetting to add `'bootstrap3'` to your `INSTALLED_APPS` in `settings.py` will prevent the library's template tags from being recognized by Django, leading to `ImproperlyConfigured` errors.
fix
Ensure `INSTALLED_APPS` in your `settings.py` includes `'bootstrap3'`: `INSTALLED_APPS = ['...', 'bootstrap3', '...']`.
affects: All versions
gotchaOmitting `{% load bootstrap3 %}` at the beginning of your Django template will cause `TemplateSyntaxError` for all `bootstrap3`-related tags, as the tag library won't be available.
fix
Always place `{% load bootstrap3 %}` as the very first line in any Django template that uses `django-bootstrap3` tags.
affects: All versions
gotchaIf your forms or other components are not displaying with Bootstrap 3 styles, you might be missing `{% bootstrap_css %}` and/or `{% bootstrap_javascript %}` in your template's `<head>` section, or static files are not served correctly in production.
fix
Include `{% bootstrap_css %}` and `{% bootstrap_javascript %}` in the `<head>` of your base template. For production, ensure `python manage.py collectstatic` has been run and static files are served.
affects: All versions
Upgrade
Version history
26.1latest on PyPI · released Jan 3, 2026
Audit
Dependencies
DjangorequiredRequired for any Django project integration.
Agent activity
11 hits · last 30 days
node
10
Resources
django-bootstrap3 — pip install django-bootstrap3 · libregistry