{% load django_bootstrap5 %}
{% load i18n %}
<form class="was-validated" method="post" action="{{ form_action }}" novalidate>
    {% csrf_token %}

    {% bootstrap_form_errors form type='non_fields' %}

    {% for field in form %}
        <div class="mb-4">
            <legend>{{ field.label }}:</legend>
            {{ field }}
            {% if field.help_text %}
                <p class="form-text mb-1" id="{{ field.auto_id }}_helptext">
                    {{ field.help_text|safe }}
                </p>
            {% endif %}
            {% for error in field.errors %}
                <div class="text-danger">{{ error }}</div>
            {% endfor %}
        </div>
    {% endfor %}
    
    <button type="submit" class="btn btn-primary mt-3">{% translate "Submit" %}</button>
</form>