Home Backend Development Python Tutorial Detailed explanation of how to use the forms form class in Python's Django framework

Detailed explanation of how to use the forms form class in Python's Django framework

Jul 21, 2016 pm 02:53 PM
django python form

Form form functions

  • Automatically generate HTML form elements
  • Check the legality of form data
  • If validation error occurs, redisplay the form (data will not be reset)
  • Data type conversion (character type data is converted into the corresponding Python type)

Form related objects include

  • Widget: A tool used to render HTML elements, such as: forms.Textarea corresponds to the