Learn three simple Django (example)

In Django form simple form processing

Example:

  Django, form submission using form data, responding to user requests after background processing

  1. Definitions urls route "index /"

  

 

  2. Write performance function under views

  

  

  3. Write HTML

    Form submission using the form user data:

      Address action is submitted, the equivalent of url routing

      mode request method (typically get or post)

    Here form interpreted as: Submit Data to "/ test" under Django route, according to the origin of the call-down views urls.py Central Processing

  

 

 

  4. The results are:

  

 

   

  5. After the input data submitted

   

 

Guess you like

Origin www.cnblogs.com/leafchen/p/11649728.html