https://github.com/arvrao/django-rest-framework-authentication
This project explains working of Django's Rest framework authentication system. We do API authentication using JWT tokens. We create a custom user class that modifies existing Django's base User class to login using email.
https://github.com/arvrao/django-rest-framework-authentication
django djangorestframework jwt-authentication python token-based-authentication
Last synced: 3 months ago
JSON representation
This project explains working of Django's Rest framework authentication system. We do API authentication using JWT tokens. We create a custom user class that modifies existing Django's base User class to login using email.
- Host: GitHub
- URL: https://github.com/arvrao/django-rest-framework-authentication
- Owner: ArvRao
- Created: 2021-07-23T18:15:00.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-23T18:49:01.000Z (almost 4 years ago)
- Last Synced: 2025-04-12T21:12:39.726Z (3 months ago)
- Topics: django, djangorestframework, jwt-authentication, python, token-based-authentication
- Language: Python
- Homepage: https://github.com/arvind73/Django-Rest-Framework-Authentication
- Size: 12 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django-Rest-Framework-Authentication
This project explains working of Django's Rest framework authentication system. We do API authentication using JWT tokens. We create a custom user class that modifies existing Django's base User class to login using email.Step 1:
Run the virtual Environment:source env/bin/activate
Step 2: Install all dependencies:
cd authtutorialpip install -r requirements.txt
Step 3: Run the migrations and create database
python3 manage.py makemigrations
python3 manage.py migrate
Step 4: Run the server
python3 manage.py runserver
Tutorial:
Register users by providing their name, unique email and password.
User login:

A unique JWT token is generated if valid credentials are passed. We create a custom cookie variable to store a token inside it.
And finally the logout view. Here the cookie is completely destroyed using the built-in delete_cookie method.

Finally the cookie is destroyed when the user logs out of the application.
Hope you found this helpful. Hope you love it.
Cheers!