This Django app provides a secure and efficient method for authenticating users via token-based authentication. Upon successful login, the app generates an authentication token and stores it in a cookie, which is then used for subsequent requests to access protected resources. This approach ensures that user sessions are securely maintained without relying on traditional session-based authentication mechanisms
api/users/singup/ For creating a user instance.
api/users/login/ For generating an auth token and store in cookies.
api/users/logout/ To logout a user by removing the user's auth token in the cookies.
api/users/me/ To get the current logged in user's information.
Clone the project
git clone https://github.com/aliii010/token-authentication-Django.gitGo to the project directory
cd token-authentication-DjangoSet up a vertual environment
Python3 -m venv venvActivate the vertual environment (on macOS)
source venv/bin/activateInstall the dependencies
pip install -r requirements.txtRun the server
Python3 manage.py runserver