URL Routes and Views
Explore how to bind URL routes to view functions in Flask using the route decorator. This lesson helps you understand static routing, defining meaningful URLs, and creating basic views to respond to web requests in your Flask app.
Introduction
The homepage of a website can usually be found at the URL hostname followed by /, /home, /index or something self-explanatory.
These kinds of URLs enable the users to remember the URL and access it easily. It would be unexpected if the homepage were at a random URL such as /39283@&3911 or /more_eggs.
Flask allows us to use the route() decorator to bind a meaningful URL to each view function we create.
What is a view function?
In Flask, we create a function that acts as the view. Then, we bond it with a route.