Django Code Snippets

Powered by PythonAnywhere and Django 1.8.6

Django Form Snippet with Bootstrap 3

Date Added: Nov. 12, 2015, 4:19 p.m.

Author: django-snippets



{% csrf_token %} {% if form.non_field_errors %}
{{ form.non_field_errors|join:"
" }}
{% endif %} {% for field in form %}
{{ field.label_tag|add_class:"control-label" }} {% if field.help_text %} {{ field.help_text }} {% endif %} {% if field.errors %} {{ field.errors|join:"
" }}
{% endif %} {{ field|add_class:"form-control" }}
{% endfor %}

 

Tags: django, python

Return to List