Now, in order for us to really test and see if the vote functionality is working, we've got to have
another user that can vote for the same post.
So in order to do this, we can go inside of our Django admen, for example, and go to users and add
a new user, for example.
I went in, made a new user.
Nick, if you want to make your own use, you can hit ad user, type the user name, password, save
it, all that good stuff.
But Nick here, if I want to log in as Nick, I can't log in via the Admon here.
Like if I log out of the admin panel, then come back to just, you know, slash admen and I say, hey,
I want to log in, as Nick and I put in Nick's password.
It's going to say, hey, you know, this is not a user that can access the Admon.
So you may be thinking, well, how do I, you know, log in so I can test out the the API here?
Well, another great thing about the rest framework is if we come back to our project, let's go over
to our your ls not pi.
They've actually implemented some code so that you can sort of test out users here.
All right.
On your Web site.
Very easily.
So we're gonna go ahead and add a new path here.
And what we're gonna be looking for is the API dash off.
This doesn't have to be this name, but this is typically what's used here.
And we're gonna say comma include OK with parentheses.
And since we're using include, we've got to import that.
So after path, we're going to say we also want to import include.
OK, and what we're trying to include is a string that says, rest, underscore, frame, work, dot,
you are case, what's going to pass forward?
Anything pass that there.
So just by adding this, if we go ahead and hit save here and come back to our page, I want you to
notice, if I just reload this here, look at what we have at the top.
A log in button.
So now I can hit log in.
I can take my neck user pass in my password just like that.
Log in and look at that.
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
the functionality.
I got to try voting for the one post.
So I'm gonna go ahead and do a post there and look at that.
It's made a vote.
And if I try and vote again, it says you've already voted.
And if we come back to the admen, which I'm gonna have to sort of switch back here, let's go ahead
and log in there to a.
Whoops.
It's not like what I have.
Let's try this again.
All right.
If we look at our votes, there's only those two objects, so our code is working perfectly.
All right.
So that was a little bit a short one to give you a break there.
But it's good to know that everything's working out here.
Really the next step for us.
I've got to add just a little bit more detail.
For example, what if someone voted for something but they wanted it to take it back?
Maybe they their fingers slipped on the app that is using our API.
And they said, oh, I voted for this, but actually didn't want to do it.
How do we delete things?
Well, we'll talk about that in the next lecture.