WEBVTT 00:00.450 --> 00:05.490 So I think the first step for us is we've got to have a place that we can write our API code. 00:05.520 --> 00:11.520 We should make an app for our API and then we should also add the jingle rest framework into our project. 00:11.700 --> 00:15.270 So let's go ahead and go back to the terminal where currently the server is running. 00:15.270 --> 00:17.640 So I'm going to do a control C to stop that. 00:18.150 --> 00:25.980 And then what I'm going to do is add a new app by saying Python three managed up high start app and 00:25.980 --> 00:28.320 I'm just going to simply call this API. 00:28.960 --> 00:33.480 OK, so now that we've added that, let's go ahead and open up this project and Adam so that we can 00:33.480 --> 00:35.670 get a good view on what it is that we're looking at. 00:37.200 --> 00:39.110 Open up the to do project. 00:40.200 --> 00:45.570 And here it is, you can see inside of the project, we have this API app that we just created, but 00:45.570 --> 00:50.040 then there's the existing to do app with all of its models and what not. 00:50.130 --> 00:54.900 And then we have the to do, which is got our settings and all those different pieces there. 00:55.230 --> 01:00.480 So let's go ahead and make sure that we add the Django rest framework into our project. 01:00.510 --> 01:05.910 Now, you should already have the Django rest framework installed on your computer, but just in case 01:05.910 --> 01:08.460 you haven't remember, that's PIP three install. 01:08.910 --> 01:13.160 And then we want to do Django rest frame work. 01:13.440 --> 01:14.760 All one word game. 01:15.760 --> 01:18.340 But we've already got that on the computer here. 01:18.490 --> 01:25.540 So not an issue, but with this now let's go ahead and move back to our settings and we want to go into 01:25.540 --> 01:27.040 our installed apps. 01:27.190 --> 01:30.550 So we're going to first add the app for our API. 01:31.630 --> 01:33.580 That we created up there. 01:33.670 --> 01:34.000 Right. 01:34.330 --> 01:39.670 And then also we want to do our rest underscore framework. 01:41.240 --> 01:44.360 Don't forget that trailing comma there so we can add more if we need to. 01:44.530 --> 01:44.700 OK. 01:44.930 --> 01:48.020 So I'm gonna go ahead and save my settings, stop pie. 01:48.620 --> 01:54.440 And with this, really, the next thing that I'd like to do is set up the URLs a little bit better in 01:54.440 --> 01:56.030 this project than we did last time. 01:56.060 --> 02:00.980 Now, it didn't really matter because last time the whole entire project was an API. 02:01.010 --> 02:03.800 But where we are here, you can see if we go to our U. 02:03.800 --> 02:07.220 URLs, that pie, there's already quite a bit moving on here. 02:07.550 --> 02:11.840 I'd like this sort of separate the API code to be at API. 02:11.840 --> 02:15.770 Your ls rather to be completely separate from all the other your URLs. 02:15.860 --> 02:21.260 So what I'm gonna do here is just leave a comment to say that says, you know, this is the API that 02:21.260 --> 02:22.550 we're working with over here. 02:23.540 --> 02:29.420 And what we're gonna do is create a new path, get that trailing comma. 02:29.870 --> 02:35.520 But what we'll do here is just sort of forward everything into the API app. 02:35.570 --> 02:42.350 So what we're gonna do is say if anybody, you know, type something in here that says API slash, we 02:42.350 --> 02:43.250 want to forward it. 02:43.280 --> 02:48.210 So we're going to say that API slash is going to use and include. 02:48.730 --> 02:48.990 Okay. 02:50.060 --> 02:55.790 And what we want to include is a u r el's dot py file, which we don't have yet. 02:55.820 --> 02:56.450 So let's go ahead. 02:56.450 --> 02:58.910 Move over to this API folder. 02:59.210 --> 02:59.780 I'm going to Right. 02:59.780 --> 03:01.310 Click and say new file. 03:01.940 --> 03:03.670 I want a u r stop pie. 03:04.460 --> 03:04.690 Okay. 03:05.450 --> 03:08.360 Now that that exists there you can go ahead. 03:08.360 --> 03:12.530 Move back to are your URLs that pie for the whole project. 03:13.070 --> 03:18.730 I could say please include api dot u or else. 03:19.420 --> 03:19.610 Okay. 03:20.750 --> 03:26.490 Now, since we have done this, we've got to make sure that we have the proper code to use this include 03:26.490 --> 03:29.990 and currently it's not listed up here because we haven't done in include yet. 03:30.350 --> 03:35.220 So just after path here, make sure you add a trailing comma and then do include Kane. 03:35.330 --> 03:36.770 We'll go ahead and save that. 03:37.550 --> 03:41.340 And with that, we're at a really good starting point for our app. 03:41.340 --> 03:44.930 Were saying any information, anything that's, you know, API slash. 03:44.960 --> 03:50.330 We're gonna forward this to this your El's Dot Pi file here inside of the API app. 03:50.630 --> 03:53.330 We've got the Gengel rest framework ready to rock and roll. 03:53.600 --> 03:55.700 Let's go ahead and move into our next lecture. 03:55.700 --> 03:59.060 WorldWar Start knocking out functionality in our API.