{% load rest_framework %}
{% csrf_token %}
{{ form.non_field_errors }}
{% for field in form.fields.values %}
    {% if not field.read_only %}
    <div class="control-group {% if field.errors %}error{% endif %}">
        {{ field.label_tag|add_class:"control-label" }}
        <div class="controls">
            {{ field.widget_html }}
            {% if field.help_text %}<span class="help-block">{{ field.help_text }}</span>{% endif %}
            {% for error in field.errors %}<span class="help-block">{{ error }}</span>{% endfor %}
        </div>
    </div>
    {% endif %}
{% endfor %}
