Skip to main content

django-phone-auth

A Django app to authenticate and register user using phone/email/username. It uses default User Model.

Installation

pip install django-phone-auth

Add 'phone_auth' in INSTALLED_APPS.

INSTALLED_APPS = [
    ...
    'phone_auth'
]

Add 'phone_auth.backend.CustomAuthBackend' in AUTHENTICATION_BACKENDS.

AUTHENTICATION_BACKENDS = [
    'django.contrib.auth.backends.ModelBackend',
    ...
    'phone_auth.backend.CustomAuthBackend',
]

Add 'path('accounts/', include('phone_auth.urls'))' in urls.py

urlpatterns = [
    ...
    path('accounts/', include('phone_auth.urls'))
]

Now run command -

python manage.py migrate

Usage

On registration page ('accounts/register/') by default first_name, last_name, email and username is optional. These can be set to required by adding following variables in settings.py

REGISTER_USERNAME_REQUIRED = True
REGISTER_EMAIL_REQUIRED = True
REGISTER_FNAME_REQUIRED = True
REGISTER_LNAME_REQUIRED = True

On login page ('accounts/login/') by default user can only login with phone. To allow login through username/email/phone add following in settings.py

LOGIN_METHODS = {'email', 'phone', 'username'}

Note: LOGIN_METHODS can't be empty

Metadata

Release files for django-phone-auth 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-phone-auth 0.1
File Size Uploaded
django-phone-auth-0.1.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-phone-auth 0.1
File Interpreter ABI Platform
django_phone_auth-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / django-phone-auth-0.1.tar.gz

Download URL django-phone-auth-0.1.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
17d0336960f45fdbabd1863d1146904cb50b5431b16c4b75e1714a5cc225d694
BLAKE2b-256 checksum
How to use checksums
9c3ef2f3b652d16b3dc7ad3fc1c469d351d53121e50aa5bb4a9f1d91c0ba83f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/54.1.2 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

Release files / django_phone_auth-0.1-py3-none-any.whl

Download URL django_phone_auth-0.1-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59b4e7c9820bf6d679ff58e4a08f8f4938b05c0ccedc819ef2b5a3bd856c004f
BLAKE2b-256 checksum
How to use checksums
2e7ff4418dd12d5b906e8be15c849165b051c5b2c3aec4e2b61c8fac2a5a06d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/54.1.2 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

Release history Release notifications | RSS feed

0.3.1

2 release files

0.3

2 release files

0.2

2 release files

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page