Hello, friends, in this video, we shall see what is routing in the flask framework.
The modern web frameworks use the technology, which is called less MVC, which stands for Model View
and Control.
So all the Web frameworks, especially specifically the python frameworks like Flask, Dangol, etc.,
they're all using the MVC technique.
In which the routing plays a very important role.
The Web application or the Web server contains a whole lot of Web pages, so you either have to remember
the exact name of the page that you want to access.
Loaded into the browser, or you can start from the home page and then follow the links.
So what we are very curious, the mechanism that this MVC frameworks use is that the rules are defined,
the rules are defined and the rules are mapped with corresponding functions.
So that is the technique which is used in most of these modern web frameworks in flask.
This group decorator plays a very important role, Eppy, Dr. Ruth.
What does it do, it binds a particular you are ill defined, that you are ill and binds with a underlying
function, which is generally called view function.
So this route, the corridor is most frequently used in any Web based application built on the top of
a flask, Trimbole.
For instance.
This.
Part of the call you can have a look at this is the definition of the you are alone, you are in flesh.
Hello.
And in order to define this.
You are a rule you are using at hope, not rule.
The route is the decoratively just below this, just below this line.
There is a functional difference and this is a regular python from Python function, starting with Def
Buffalo World.
Now, this will start a indented block of statements that may be any number of indented block letters,
statements in this block, the last line is written, some results should be returned there to the brother.
So this will be rendered to the process.
So this is the way in which the road, the corridor is defined.
The usual hello is defined and it is bound to the function of the law.
So when you start the server.
Last time we saw how the python hollowed out behind, started the service, actually go to the browser,
give the you are less HTP localhost five thousand slash.
Hello.
This is, of course, the name of the server slash.
Hello.
Is the URL that you are giving or submitting to the server as soon as it is received by the server though,
what is the function that is associated with it?
That function will be executed and the result will be rendered.
So that is how the routing takes place in the last Bassler application.