Next let's test our login API in the browser open up the terminal or git bash
window and connect to our vagrant server by typing vagrant SSH once you're
connected type cd forward slash vagrant and then type source tilde
forward slash env slash bin slash activate
to activate the virtual environment then
start the Django management server by typing Python manage dot py run server
0.0.0.0 : 8000 hit enter and then open up your browser and we're going to head
over to 127.0.0.1 : 8000 forward slash api
forward slash login this is the login api that we created in the previous
video you can see that it has a username and password input the username is the
username field that we're going to be using for authentication which is mapped
to the email field so if we head over to the atom editor and you open up the
models dot py file in our profiles API you can see that we set the username
field to email now since we're using the Django admin built-in authentication
system it still calls the field username there even though we mapped it to our
email field but all you need to know is that the user
name needs to be the identifier which is the email that we use for the login so
let's try and create an authentication token with our login API I'm going to
try with my mark@londonappdev.com username and then I'm going to put the
password as password 1 2 3 and then hit post you can see that after I posted
this I received
a token which is my authentication token that I can use to authenticate future
requests to our API in a future video I'm going to show you how to assign this
token to the headers of a request so you can authenticate an API request so
that's how you test the API login endpoint thank you for watching and I'll
see you in the next video