To validate the data submitted by users using HTML forms, the recommended solution is to use server-end validation in Django by defining validating the functions in Django forms.
A Django form is a python class which generates HTML form and may be directly connected to a model to save the data. Before saving the data, form can be used to validate the submitted data by using class functions.
A validating function has a name which has prefix as clean_ added to the field name. For example, clean_city is the name of a validating function which validates data for a city name from the field city.
Please watch the video carefully to understand the concepts.