Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

form errors in django

#non-field errors ca be accessed in html via
{{form.non_field_errors}}
# or
   {% if form.non_field_errors %}
           {% for error in form.non_field_errors %} 
              <div class="alert alert-danger">
                   <strong>{{ error|escape }}</strong>
              </div>
           {% endfor %}
    {% endif %}
#Remember to include raising this error in your forms.py file
 
PREVIOUS NEXT
Tagged: #form #errors #django
ADD COMMENT
Topic
Name
6+8 =