Skip to main content

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

Project description

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

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",
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alfer_django_authx-0.1.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alfer_django_authx-0.1.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file alfer_django_authx-0.1.1.tar.gz.

File metadata

  • Download URL: alfer_django_authx-0.1.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for alfer_django_authx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0f88e294fb9f3f725a71f7f23f7e1e5144da4b520c0ab2e5f96ea19217f98403
MD5 fbff99a7e057bec5bef5619bec3af968
BLAKE2b-256 22a650d0a8d1e4d25f1b6b61930c4dae3192235902c6c12ae8ef462bddbee0cd

See more details on using hashes here.

File details

Details for the file alfer_django_authx-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for alfer_django_authx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b350b3804670f854087a40070d54ccf5b1407eb84ec983ad178c4110e4d677ba
MD5 b03d1456cfdffb5efa7d3f7f75f7bbe7
BLAKE2b-256 1f8b46c828afee7d5d66fbe5e35ab9d9afc6eff5589229e2b5c7215232e19e31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page