Registry / web-framework / crispy-bootstrap4

crispy-bootstrap4

JSON →
library2026.2pypypiunverified

crispy-bootstrap4 is a template pack for django-crispy-forms, providing Bootstrap 4 styling for Django forms. It facilitates rendering forms elegantly without extensive manual HTML, offering control over layout and appearance. The library is actively maintained, with a version 2026.2 released on February 11, 2026, and follows a frequent release cadence, often coinciding with Django and Python version updates.

pip install crispy-bootstrap4
INSTALL
IMPORT
SIG · CRISPY-BOOTSTRAP4
C
crispy-bootstrap4
web-frameworkpythonv2026.2
Install
3.5s avg
Import
—
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2026.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.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.8MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 3.5s · import 0.000s · 67MB
66MB installed
● package 66MB
Code
Verified usage

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

crispy_forms
✓ INSTALLED_APPS = [ # ... 'crispy_forms', 'crispy_bootstrap4', ]
crispy-bootstrap4 is configured in Django's settings.py as an INSTALLED_APP. Note the use of underscore ('crispy_bootstrap4') in INSTALLED_APPS, not hyphen.
CRISPY_TEMPLATE_PACK
✓ CRISPY_TEMPLATE_PACK = 'bootstrap4'
Set this in your Django settings.py to define the default template pack for crispy-forms.

To use crispy-bootstrap4, add 'crispy_forms' and 'crispy_bootstrap4' to your `INSTALLED_APPS` in `settings.py`. Then, set `CRISPY_TEMPLATE_PACK = 'bootstrap4'` to make it the default template pack. In your Django templates, load `crispy_forms_tags` and render your form using `{% crispy form %}`. Remember to manually include Bootstrap 4's CSS and JavaScript in your base templates, as crispy-bootstrap4 only provides the template logic, not the static assets.

# settings.py INSTALLED_APPS = [ # ... other Django apps 'crispy_forms', 'crispy_bootstrap4', ] CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap4' CRISPY_TEMPLATE_PACK = 'bootstrap4' # my_app/forms.py from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Submit class ContactForm(forms.Form): name = forms.CharField(label='Your Name') email = forms.EmailField(label='Your Email') message = forms.CharField(widget=forms.Textarea, label='Your Message') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( 'name', 'email', 'message', Submit('submit', 'Send Message', css_class='btn-primary') ) # my_app/templates/my_app/contact.html {% load crispy_forms_tags %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact Us</title> <!-- Include Bootstrap 4 CSS and JS manually --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> </head> <body> <div class="container"> <h1>Contact Us</h1> <form method="post"> {% csrf_token %} {% crispy form %} </form> </div> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> </body> </html>
Debug
Known issues
breakingSupport for several Django versions has been removed in recent releases. Version 2026.2 dropped support for Django 4.2, 5.0, and 5.1. Version 2023.1 previously dropped Django 3.2, 4.0, and 4.1.
fix
Ensure your Django project uses a currently supported version (e.g., Django 5.2 or 6.0 with crispy-bootstrap4 2026.2).
affects: 2023.1, 2026.2 and later
breakingSupport for `django-crispy-forms` 1.x was dropped in version 2023.1, and the minimum supported version was bumped to 2.3 in 2024.10.
fix
Upgrade your `django-crispy-forms` package to version 2.3 or higher.
affects: 2023.1, 2024.10 and later
gotchaWhen adding to `INSTALLED_APPS` in `settings.py`, use the Python package name with an underscore: `crispy_bootstrap4`. Using the PyPI package name with a hyphen (`crispy-bootstrap4`) will result in an `ModuleNotFoundError`.
fix
Correct `INSTALLED_APPS = ('crispy-bootstrap4',)` to `INSTALLED_APPS = ('crispy_bootstrap4',)`.
affects: All versions
gotchaThis template pack does not include Bootstrap 4's CSS or JavaScript assets. You must manually link to Bootstrap 4's CSS and JS files in your Django templates (e.g., via CDN or local static files) for forms to render with the correct styling.
fix
Include `<link>` tags for Bootstrap 4 CSS and `<script>` tags for Bootstrap 4 JavaScript (and its dependencies like jQuery and Popper.js) in your base HTML template.
affects: All versions
gotchaThe `id` attribute for help text generated by forms changed in version 2025.6 to align with the `aria-describedby` attribute added by Django 5.0+. This might impact custom JavaScript or CSS that relied on the previous help text `id` structure.
fix
Review and update any custom frontend code that interacts with or styles form help text based on its `id` attribute to match the new structure introduced with Django 5.0+ compatibility.
affects: 2025.6 and later
Upgrade
Version history
2026.2latest on PyPI · released Feb 11, 2026
Audit
Dependencies
django-crispy-formsrequiredRequired as the core forms rendering library, crispy-bootstrap4 is a template pack for it.
Djangorequiredcrispy-bootstrap4 is a Django application.
Agent activity
10 hits · last 30 days
node
10
Resources
crispy-bootstrap4 — pip install crispy-bootstrap4 · libregistry