1 00:00:00,730 --> 00:00:06,730 Hello, friends, in this video, we shall see what is routing in the flask framework. 2 00:00:10,560 --> 00:00:21,960 The modern web frameworks use the technology, which is called less MVC, which stands for Model View 3 00:00:21,960 --> 00:00:22,730 and Control. 4 00:00:23,580 --> 00:00:30,960 So all the Web frameworks, especially specifically the python frameworks like Flask, Dangol, etc., 5 00:00:31,320 --> 00:00:33,990 they're all using the MVC technique. 6 00:00:35,000 --> 00:00:38,310 In which the routing plays a very important role. 7 00:00:40,780 --> 00:00:49,690 The Web application or the Web server contains a whole lot of Web pages, so you either have to remember 8 00:00:49,690 --> 00:00:52,720 the exact name of the page that you want to access. 9 00:00:53,680 --> 00:00:58,960 Loaded into the browser, or you can start from the home page and then follow the links. 10 00:01:00,030 --> 00:01:12,240 So what we are very curious, the mechanism that this MVC frameworks use is that the rules are defined, 11 00:01:13,380 --> 00:01:19,180 the rules are defined and the rules are mapped with corresponding functions. 12 00:01:19,920 --> 00:01:25,470 So that is the technique which is used in most of these modern web frameworks in flask. 13 00:01:26,630 --> 00:01:31,760 This group decorator plays a very important role, Eppy, Dr. Ruth. 14 00:01:33,140 --> 00:01:40,340 What does it do, it binds a particular you are ill defined, that you are ill and binds with a underlying 15 00:01:40,760 --> 00:01:43,370 function, which is generally called view function. 16 00:01:44,740 --> 00:01:53,830 So this route, the corridor is most frequently used in any Web based application built on the top of 17 00:01:53,830 --> 00:01:54,830 a flask, Trimbole. 18 00:01:56,100 --> 00:01:56,820 For instance. 19 00:01:57,950 --> 00:01:58,550 This. 20 00:01:59,780 --> 00:02:05,670 Part of the call you can have a look at this is the definition of the you are alone, you are in flesh. 21 00:02:05,700 --> 00:02:06,050 Hello. 22 00:02:08,280 --> 00:02:09,930 And in order to define this. 23 00:02:11,800 --> 00:02:16,270 You are a rule you are using at hope, not rule. 24 00:02:17,420 --> 00:02:21,440 The route is the decoratively just below this, just below this line. 25 00:02:21,970 --> 00:02:26,650 There is a functional difference and this is a regular python from Python function, starting with Def 26 00:02:27,140 --> 00:02:28,060 Buffalo World. 27 00:02:29,680 --> 00:02:37,000 Now, this will start a indented block of statements that may be any number of indented block letters, 28 00:02:37,000 --> 00:02:45,640 statements in this block, the last line is written, some results should be returned there to the brother. 29 00:02:46,330 --> 00:02:48,030 So this will be rendered to the process. 30 00:02:48,820 --> 00:02:53,200 So this is the way in which the road, the corridor is defined. 31 00:02:54,070 --> 00:02:58,810 The usual hello is defined and it is bound to the function of the law. 32 00:02:59,740 --> 00:03:01,510 So when you start the server. 33 00:03:03,230 --> 00:03:10,640 Last time we saw how the python hollowed out behind, started the service, actually go to the browser, 34 00:03:11,210 --> 00:03:15,370 give the you are less HTP localhost five thousand slash. 35 00:03:15,410 --> 00:03:15,740 Hello. 36 00:03:16,610 --> 00:03:18,980 This is, of course, the name of the server slash. 37 00:03:18,980 --> 00:03:19,220 Hello. 38 00:03:19,220 --> 00:03:27,070 Is the URL that you are giving or submitting to the server as soon as it is received by the server though, 39 00:03:27,290 --> 00:03:29,440 what is the function that is associated with it? 40 00:03:29,690 --> 00:03:33,270 That function will be executed and the result will be rendered. 41 00:03:33,620 --> 00:03:39,260 So that is how the routing takes place in the last Bassler application.