Quickstart

After Installation, you can use django-bootstrap5 in your templates.:

Load the django_bootstrap5 library and use the bootstrap_* tags:

Example template

{# Load the tag library #}
{% load django_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 %}

  {% bootstrap_button button_type="submit" content="OK" %}
  {% bootstrap_button button_type="reset" content="Cancel" %}

</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-bootstrap5 in your settings file. Refer to Settings for more information.

Demo application

The demo application provides a number of useful examples.

https://github.com/zostera/django-bootstrap5/tree/main/example