WEBVTT 00:00.420 --> 00:05.340 Now, in order for us to really test and see if the vote functionality is working, we've got to have 00:05.340 --> 00:08.040 another user that can vote for the same post. 00:08.790 --> 00:15.600 So in order to do this, we can go inside of our Django admen, for example, and go to users and add 00:15.600 --> 00:16.830 a new user, for example. 00:16.860 --> 00:18.660 I went in, made a new user. 00:18.660 --> 00:23.310 Nick, if you want to make your own use, you can hit ad user, type the user name, password, save 00:23.310 --> 00:24.300 it, all that good stuff. 00:24.960 --> 00:31.890 But Nick here, if I want to log in as Nick, I can't log in via the Admon here. 00:31.890 --> 00:38.880 Like if I log out of the admin panel, then come back to just, you know, slash admen and I say, hey, 00:38.880 --> 00:42.630 I want to log in, as Nick and I put in Nick's password. 00:42.960 --> 00:48.440 It's going to say, hey, you know, this is not a user that can access the Admon. 00:48.450 --> 00:54.330 So you may be thinking, well, how do I, you know, log in so I can test out the the API here? 00:54.840 --> 01:00.570 Well, another great thing about the rest framework is if we come back to our project, let's go over 01:00.570 --> 01:02.070 to our your ls not pi. 01:02.610 --> 01:06.960 They've actually implemented some code so that you can sort of test out users here. 01:07.050 --> 01:08.460 All right. 01:08.490 --> 01:09.390 On your Web site. 01:09.420 --> 01:10.290 Very easily. 01:10.290 --> 01:13.020 So we're gonna go ahead and add a new path here. 01:14.160 --> 01:18.390 And what we're gonna be looking for is the API dash off. 01:18.450 --> 01:22.890 This doesn't have to be this name, but this is typically what's used here. 01:23.310 --> 01:29.040 And we're gonna say comma include OK with parentheses. 01:29.040 --> 01:31.350 And since we're using include, we've got to import that. 01:31.380 --> 01:35.580 So after path, we're going to say we also want to import include. 01:36.800 --> 01:44.420 OK, and what we're trying to include is a string that says, rest, underscore, frame, work, dot, 01:44.510 --> 01:46.640 you are case, what's going to pass forward? 01:46.640 --> 01:48.050 Anything pass that there. 01:48.590 --> 01:55.070 So just by adding this, if we go ahead and hit save here and come back to our page, I want you to 01:55.070 --> 01:59.060 notice, if I just reload this here, look at what we have at the top. 01:59.390 --> 02:00.590 A log in button. 02:00.920 --> 02:02.990 So now I can hit log in. 02:03.470 --> 02:08.770 I can take my neck user pass in my password just like that. 02:08.780 --> 02:10.910 Log in and look at that. 02:10.940 --> 02:15.890 I'm now logged in his neck and I can choose to log out here if I want to, but we've got to test out 02:15.890 --> 02:16.640 the functionality. 02:16.640 --> 02:19.100 I got to try voting for the one post. 02:19.100 --> 02:22.520 So I'm gonna go ahead and do a post there and look at that. 02:22.580 --> 02:23.330 It's made a vote. 02:23.420 --> 02:25.670 And if I try and vote again, it says you've already voted. 02:26.210 --> 02:31.700 And if we come back to the admen, which I'm gonna have to sort of switch back here, let's go ahead 02:31.700 --> 02:34.130 and log in there to a. 02:38.620 --> 02:38.880 Whoops. 02:39.190 --> 02:40.960 It's not like what I have. 02:41.960 --> 02:43.260 Let's try this again. 02:47.390 --> 02:47.900 All right. 02:48.040 --> 02:53.510 If we look at our votes, there's only those two objects, so our code is working perfectly. 02:54.050 --> 02:54.320 All right. 02:54.980 --> 02:57.830 So that was a little bit a short one to give you a break there. 02:58.610 --> 03:01.670 But it's good to know that everything's working out here. 03:02.150 --> 03:03.520 Really the next step for us. 03:03.530 --> 03:05.900 I've got to add just a little bit more detail. 03:05.900 --> 03:10.100 For example, what if someone voted for something but they wanted it to take it back? 03:10.130 --> 03:14.000 Maybe they their fingers slipped on the app that is using our API. 03:14.000 --> 03:16.970 And they said, oh, I voted for this, but actually didn't want to do it. 03:17.270 --> 03:18.740 How do we delete things? 03:18.830 --> 03:21.140 Well, we'll talk about that in the next lecture.