Quickstart¶
After Installation, you can use django-bootstrap-v5
in your templates.:
Load the bootstrap5
library and use the bootstrap_*
tags:
Example template¶
{# Load the tag library #}
{% load bootstrap5 %}
{# Load CSS and JavaScript #}
{% bootstrap_css %}
{% bootstrap_javascript %}
{# Display django.contrib.messages as Bootstrap alerts #}
{% bootstrap_messages %}
{# 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>
{# Read the documentation for more information #}
Template tags and filters¶
Refer to Template tags and filters for more information.
Settings¶
You can set defaults for django-bootstrap-v5
in your settings file. Refer to Settings for more information.
Demo application¶
The demo application provides a number of useful examples.
https://github.com/zelenij/django-bootstrap-v5/tree/main/example