{% load widget_tweaks %}
{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
{{ error }}
{% endfor %}
{% endif %}
{# Include the hidden fields #}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
{# Include the visible fields #}
{% for field in form.visible_fields %}
{{ field | add_class:"form-control" | add_error_class:"is-invalid" }}
{% if field.errors %}
{% for error in field.errors %}
{{ error }}
{% endfor %}