This code show cases the authentication in Python Django for Session authentication using CSRF Tokens. We are creating the API for the authentication using Django Django REST Framework.
In this code we are using the user model provide by the Django, and then linking it in One-To-One Relationship with the User Profile Model.