Plug-and-play Django app: JWT authentication + OTP email verification
Project description
AuthSimplified
AuthSimplified is a Django authentication package designed to give you a ready-to-use OTP-based email verification and token authentication system in minutes. It includes user registration, login, logout, OTP verification, and OTP resend — without the hassle of wiring everything yourself.
Features
User registration with OTP email verification.
Login with Django REST Framework Token authentication.
Logout with JWT refresh token blacklisting.
OTP verification with expiry checks.
Resend OTP functionality.
Customizable SMTP email sending.
Lightweight and easy to integrate into existing Django projects.
Installation
Install via pip:
pip install authsimplified
Setup & Configuration
After installing, you need to integrate it into your Django project.
- Add to Installed Apps
In your settings.py:
INSTALLED_APPS = [ ... 'rest_framework', 'rest_framework.authtoken', 'authsimplified', ]
-
Configure Authentication Backends AUTH_USER_MODEL = 'authsimplified.User'
-
Configure Django REST Framework REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.TokenAuthentication', ], }
-
Configure SMTP for Email Sending
AuthSimplified sends OTPs via email. You need to configure SMTP settings in your settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.yourmailprovider.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = 'your_email@example.com' EMAIL_HOST_PASSWORD = 'your_password' DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
Using Gmail SMTP
If you want to use Gmail:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = 'yourgmail@gmail.com' EMAIL_HOST_PASSWORD = 'your_gmail_app_password' DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
Note: For Gmail, you need to create an App Password from your Google account settings. Go to Google Account → Security → App passwords and generate one.
- Include AuthSimplified URLs
In your project’s urls.py:
from django.urls import path, include
urlpatterns = [ ... path('auth/', include('authsimplified.urls')), ]
- Run Migrations python manage.py migrate
API Endpoints Endpoint Method Description /auth/register/ POST Register a user and send OTP /auth/login/ POST Login user with token authentication /auth/logout/ POST Logout user and blacklist JWT token /auth/verify/ POST Verify OTP and activate user /auth/resend-otp/ POST Resend OTP to user’s email Example Usage Register POST /auth/register/ Content-Type: application/json
{ "email": "user@example.com", "password": "password123", "first_name": "John", "last_name": "Doe" }
Verify OTP POST /auth/verify/ Content-Type: application/json
{ "otp": "123456" }
Login POST /auth/login/ Content-Type: application/json
{ "email": "user@example.com", "password": "password123" }
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file authsimplified-0.1.0.tar.gz.
File metadata
- Download URL: authsimplified-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fadc10f57cb1b66b503dfaf7dc3eb2fbd00a107e5ebb4a230b7414ba8ff8919c
|
|
| MD5 |
d43c475a0af115898db88b534261cfb3
|
|
| BLAKE2b-256 |
e67faef466f5b4daa93c9707ab6788f3bfe25827c6f88d34201ec4358c171f00
|
File details
Details for the file authsimplified-0.1.0-py3-none-any.whl.
File metadata
- Download URL: authsimplified-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f66c0d2566c45847f1239fd90e64bb625b56818844baec47a9667ce9b694c5c1
|
|
| MD5 |
16b0251d6b5bf2ac035e72778c33c1da
|
|
| BLAKE2b-256 |
fcaa403f22a2f4c5746e67c2958a688f8f00f314a127f67fe9b93dc0bfc2ddc1
|