I personally would recommend a token-based authentication , so you don’t have to worry about clients intercepting user’s credentials.
Read moreHow do I authenticate in Django?
User authentication in Django
Read moreHow do I use token based authentication in Django REST Framework?
Setup the Login Function and api route Here we have created a login function which handled the POST request and get username and password as params and then authenticate them if they are correct then return the token if they are correct else return the not found response. map the /api/login route with our function.
Read moreHow does Django REST Framework authentication work?
Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with . The permission and throttling policies can then use those credentials to determine if the request should be permitted.
Read moreHow do I create a custom user model in Django REST Framework?
Custom User model
Read moreHow do I start a Django REST Framework?
Start Using the API!
Read more