Skip to content

kihuni/authAPP-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ AuthAPI β€” Django REST Authentication with Djoser

This project sets up a user authentication system using Django, Django REST Framework, and Djoser for token-based authentication and password reset functionality.


πŸš€ Features (In Progress)

  • βœ… User Signup
  • βœ… User Login with Token Authentication
  • βœ… User Logout
  • βœ… Password Reset via Email (Console backend)
  • πŸ”„ Email-based password reset confirmation via UID and token
  • πŸ”’ Secure password hashing and write-only password field
  • πŸ“¦ Djoser integrated for standardized auth endpoints


βš™οΈ Setup Instructions

1. Clone the repo

https://github.com/kihuni/authAPP-API.git
cd authapi

2. Create virtual environment & install dependencies

python -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate
pip install -r requirements.txt

3 Install requirements

pip install -r requirements.txt

4. Run migrations

python manage.py makemigrations
python manage.py migrate

5. Run the server

python manage.py runserver

πŸ” Authentication Endpoints

Endpoint Method Description
/signup/ POST Custom user registration
/login/ POST Custom user login (token)
/logout/ POST Custom user logout (token delete)
auth/users/reset_password/ POST Request password reset
/auth/users/reset_password/confirm/ POST Reset password using token+uid

πŸ§ͺ Testing Password Reset (Console)

  1. Send a POST to auth/users/reset_password/ with your email.

  2. Check the terminal for the reset link.

  3. Extract uid and token from the link.

  4. Send a POST to /auth/users/reset_password/ for example with:

{
    "email": "stephenkihuni55@gmail.com"
}

πŸ“¬ Email Configuration (Dev)

In settings.py:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

πŸ”§ Tech Stack

  • Django

  • Django REST Framework

  • Djoser

  • SQLite (default for dev)

About

Django REST Authentication with Djoser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages