Skip to content

Django-AuthAPI-with-JWT is an authentication API for Django applications using Django Rest Framework (DRF) and JSON Web Tokens (JWT). It provides functionality for user registration, login, password management, and password reset via email.

Notifications You must be signed in to change notification settings

refat-jamil/django-auth-api-with-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django-AuthAPI-with-JWT

Django-AuthAPI-with-JWT is an authentication API for Django applications using Django Rest Framework (DRF) and JSON Web Tokens (JWT). It provides functionality for user registration, login, password management, and password reset via email.

Features

  • User Registration: Allow users to create an account by providing necessary information.
  • User Login: Authenticate users and issue JWT tokens upon successful login.
  • Change Password: Enable users to change their account passwords.
  • Password Reset via Email: Send password reset emails to users for account recovery.

Installation

  1. Clone the repository:
https://github.com/rifatjamil54/Django-AuthAPI-with-JWT.git
  1. Change directory:
cd Django-AuthAPI-with-JWT
  1. Create a virtual environment (recommended):
python -m venv venv
  1. Activate the virtual environment:
  • On Windows:
venv\Scripts\activate
  • On macOS and Linux:
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Change directory:
cd AuthAPI
  1. Configure settings:

Edit the settings.py file to configure your database, email settings, and other necessary options.

  1. Apply migrations:
python manage.py makemigrations
python manage.py migrate
  1. Run the development server:
python manage.py runserver

The authentication API should now be accessible at http://127.0.0.1:8000/.

Usage

  1. Registration:

Send a POST request to http://127.0.0.1:8000/account/register/ with user registration details to create a new account.

  1. Login:

Send a POST request to http://127.0.0.1:8000/account/login/ with login credentials to receive a JWT token for authentication.

  1. Change Password:

Send a POST request to http://127.0.0.1:8000/account/changepass/ with the new password to change the user's password.

  1. Password Reset via Email:

Send a POST request to http://127.0.0.1:8000/account/send-email-rest-password/ with the user's email address to initiate a password reset process. An email with reset instructions will be sent to the user.

  1. Profile:

Send a GET request to http://127.0.0.1:8000/account/profile/ with the user's profile see user details.

  1. Rest-Password:

Send a POST request to http://127.0.0.1:8000/account/rest-password/<uid>/<token>/ with the rest-password to change the user's password.

About

Django-AuthAPI-with-JWT is an authentication API for Django applications using Django Rest Framework (DRF) and JSON Web Tokens (JWT). It provides functionality for user registration, login, password management, and password reset via email.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages