March 2019
Beginner
490 pages
12h 40m
English
The usual way to send information to the different pages of our web application is by using HTML5 forms. It is advisable to use the POST method (the information is sent in the body of the request) for sending information using forms, although if necessary we can also use the GET method (the information is sent in the URL of the request).
Creating a form in a POST application will lead us to know how to control the data we upload. Here, we will look at an example of how we can handle the POST parameters with Flask.
The first way will be to create a route that accepts a GET request that returns a form that we will render using the render_template() method:
@app.route('/',methods=['GET'])def index(): return render_template('index.html') ...Read now
Unlock full access