{% if form.non_field_errors.0 %}
<div class="alert alert-error">
    {% for error in form.non_field_errors %}{{ error }}{% endfor %}
</div>
{% endif %}

{% if form.fieldsets %}
    {% for fieldset in form.fieldsets %}
        <fieldset class="{{ fieldset.classes }}">
            {% if fieldset.legend %}
                <legend>{{ fieldset.legend }}</legend>
            {% endif %}

            {%  include 'twitter_bootstrap_form/fields.html' with fields=fieldset %}
        </fieldset>
    {% endfor %}
{% else %}
    {% include 'twitter_bootstrap_form/fields.html' with fields=form %}
{% endif %}