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