Start Validating a web page

Validating a web page

Django’s form (and model) fields support use of simple utility functions and classes known as validators.

This is cleaning that is specific to this type of field, regardless of how it is subsequently used. It’s important to keep the field and form difference clear when working out where to validate things.

Fields are single data points, forms are a collection of fields.

Be careful when doing this in practice, since it can lead to confusing form output.