Login Endpoint

Learn how to create and test the user login endpoint.

This lesson focuses on implementing the login endpoint.

Our login endpoint

When we build the endpoint, our users should be able to log in. The endpoint calls on the LoginView upon a request and submits the login credentials. The view then calls on the LoginSerializer for serialization and validation of the login credentials. The view also sees to it that, if there are any exceptions, they are raised. After the user has logged in, the user data gets rendered by this endpoint.

Let’s add the login endpoint to the other URL patterns in main/urls.py.

Get hands-on with 1200+ tech skills courses.