xxxxxxxxxx
pip install django-bootstrap-v5
//in your settings.py file...add to installed apps
INSTALLED_APPS = (
# ...
"bootstrap5",
# ...
)
In your templates, load the bootstrap5 library and use the bootstrap_* tags:
EXAMPLE .. ..
{% load bootstrap5 %}
{# Display a form #}
<form action="/url/to/submit/" method="post" class="form">
{% csrf_token %}
{% bootstrap_form form %}
{% buttons %}
<button type="submit" class="btn btn-primary">Submit</button>
{% endbuttons %}
</form>
xxxxxxxxxx
# terminal
$ pip install django-bootstrap-v5
# settings.py
INSTALLED_APPS = (
"django_bootstrap5",
)
#templates
{# Load the django_bootstrap5 library #}
{% load django_bootstrap5 %}
{# Load CSS and JavaScript separately#}
{% bootstrap_css %}
{% bootstrap_javascript %}
#example usage
<form action="/url/to/submit/" method="post" class="form">
{% csrf_token %}
{% bootstrap_form form %}
{% buttons %}
<button type="submit" class="btn btn-primary">
Submit
</button>
{% endbuttons %}
</form>