Making Websites with Flask/Routing
What is Routing?
editRouting basically means returning something to the user when they visit a specific URL on the site, which is called a route. In the Getting Started tutorial, we had two routes: the root route, /
, and /hello
.
URL Building with Route Variables
editURL building is the practice of having dynamically served URLs, that are not built in. An example of this would be if you had a /user
route, but the URL was formatted like /user/randomUser
. In a Flask app without route variables, you would manually need to add each user with @app.route
many times, but with Route Variables you can just say @app.route('/user/<name>')
, and you can show the account page.