Next we can test our API view in the browser so let's load up your browser
I'm going to use Google Chrome and then head over to the web server address
forward slash API forward slash hello - view
Once you land on the page you
should see a response like this which is the output that is returned in our response
in our views dot py hello API view so you can see that we're returning response
message and we're returning the message hello so if we go over to our browser you
can see that we have the message hello here and then we have our an API View
key which passes in our list which describes an API view and you can see
that this is passed in to the response here so what happened here when we called
the response well when you entered forward slash API slash hello view this
went to the Django dispatcher which checked the URLs dot py and then it
matched the base path with API forward slash and then it saw that it needed to
check in the profiles API dot URLs to find out how to map the rest of the URL
after API forward slash
it passed it into this and it matched it with hello view and then
it rendered our API view
So that's how the views work in Django and that's
how they map to URLs let's go ahead and commit our changes to git open up the
terminal and then head over to a terminal or git bash window that is on
our project not connected to vagrant and we're going to type git add to add any
new files and then git commit - am and we'll give it the commit message
added hello API view and then do git push origin to push this up to github so
that's how you create an API view and configure it to a URL in Django