How do Django Forms validate data? Explain the role of clean(), clean_<field>(), and is_valid().

Last updated 17 June 2026

  • is_valid() runs the full pipeline (full_clean()) and returns True only if no errors occurred. Errors go to form.errors and validated values to form.cleaned_data.

  • Order: each field first converts input (to_python) and runs built-in validators. Then clean_<field>() adds custom single-field checks, raising ValidationError and returning the cleaned value.

  • clean() runs last for cross-field validation (e.g. password confirmation). Its errors are non-field errors by default, and it returns the full cleaned_data.

  • https://docs.djangoproject.com/en/6.0/ref/forms/validation/
  • https://stackoverflow.com/questions/61375810/why-form-is-valid-does-not-returns-false-immediately-when-the-first-clean-fie
All Django interview questions