Skip to content

aliii010/token-authentication-Django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

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

Endpoints

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.

Run Locally

Clone the project

  git clone https://github.com/aliii010/token-authentication-Django.git

Go to the project directory

  cd token-authentication-Django

Set up a vertual environment

  Python3 -m venv venv

Activate the vertual environment (on macOS)

  source venv/bin/activate

Install the dependencies

  pip install -r requirements.txt

Run the server

  Python3 manage.py runserver

About

This is a sample of a token authentication Django app, that stores the token as a cookie when logging in.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages