Metadata-Version: 2.4
Name: alfer-django-authx
Version: 0.1.1
Summary: Reusable Django authentication package with email-based authentication, OTP verification, password reset, and JWT support.
Author: Alfer
License-Expression: MIT
Project-URL: Homepage, https://example.com
Keywords: django,authentication,otp,jwt,email-auth,password-reset
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: djangorestframework>=3.14
Requires-Dist: djangorestframework-simplejwt>=5.3
Requires-Dist: python-decouple>=3.8
Dynamic: license-file

# django-authx

Reusable Django authentication package with email-based authentication, OTP verification, and JWT support.

---

## 🚀 Features

- Email-based authentication (no username)
- Signup with email & password
- Email OTP verification
- Resend OTP support
- Forgot password (OTP-based)
- Reset password via OTP
- JWT authentication (access + refresh tokens)
- Role-based permissions (Admin / Manager / User)
- Fully configurable via `.env`
- Clean and consistent API response format
- Production-ready structure
- Custom signals for extensibility

---

## 📦 Installation

```bash
pip install alfer-django-authx


## 🔔 Available Signals

The package exposes the following Django signals:

- `otp_created`
- `user_verified`
- `password_reset_done`

These can be used to hook in custom business logic such as:
- sending notifications
- audit logging
- onboarding flows
- analytics events

## Required Configuration

At minimum, configure these in your Django project:

### `INSTALLED_APPS`
```python
INSTALLED_APPS = [
    ...
    "rest_framework",
    "rest_framework_simplejwt",
    "authx.apps.AuthxConfig",
]


# AUTH_USER_MODEL
AUTH_USER_MODEL = "authx.User"
# AUTHENTICATION_BACKENDS
AUTHENTICATION_BACKENDS = [
    "authx.backends.EmailBackend",
    "django.contrib.auth.backends.ModelBackend",
]
# REST_FRAMEWORK
REST_FRAMEWORK = {
    "DEFAULT_AUTHENTICATION_CLASSES": (
        "rest_framework_simplejwt.authentication.JWTAuthentication",
    ),
    "EXCEPTION_HANDLER": "authx.exceptions.custom_exception_handler",
}
