March 2019
Beginner
490 pages
12h 40m
English
One of the biggest advantages of Flask is its ability to create routes. A route is a web entry in which we can render a page or serve an endpoint of a RESTful service.
To create routes with Flask, we must use the @route annotation, which will receive the route that we will respond with as a parameter. It is necessary to associate a function that carries out the processing of the request with this annotation.
We could define a route in Flask in the following way:
@app.route("/message/")def message(name): return "Welcome "+name+"!"
Now, we are going to create a route that receives a name as a parameter and returns a reply message. This will help us to see how we can pass parameters in Python Flask routes. The first thing is ...
Read now
Unlock full access