1
0

form.html 639 B

1234567891011121314151617181920212223
  1. {% csrf_token %}
  2. {% for field in form %}
  3. <div class="mb-3">
  4. <label for="{{ field.id_for_label }}" class="form-label">{{ field.label }}</label>
  5. {{ field }}
  6. {% if field.help_text %}
  7. <small class="form-text d-block text-muted mt-1">{{ field.help_text }}</small>
  8. {% endif %}
  9. {% for error in field.errors %}
  10. <div class="invalid-feedback">
  11. {{ error }}
  12. </div>
  13. {% endfor %}
  14. </div>
  15. {% endfor %}
  16. {% if form.non_field_errors %}
  17. <div class="alert alert-danger">
  18. {% for error in form.non_field_errors %}
  19. {{ error }}
  20. {% endfor %}
  21. </div>
  22. {% endif %}