Skip to main content

build-status-image pypi-version

Django Phone Login

Django-phone-login uses django-sendsms to send sms.

Django Phone Login provides phone number login with no additional passwords to remember. It’s a easy way to grow your customer base. Without any hassle.

Installing Django Phone Login

Django Phone Login was built for django.

PyPi, install using PIP:

pip install django-phone-login

If you want to install manually:

git clone git@github.com:wejhink/django-phone-login.git
cd django-phone-login/
pip install -r requirements.txt
python setup.py install

Instructions

INSTALLED_APPS += [
    ...  # Make sure to include the default installed apps here.

    'phone_login',
    'rest_framework',
    'rest_framework.authtoken',
]


REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework.authentication.TokenAuthentication',
    )
}



AUTHENTICATION_BACKENDS = [
    'phone_login.backends.phone_backend.PhoneBackend',
    'django.contrib.auth.backends.ModelBackend'
]

# Make sure you also have backend Django Templates and APP_DIRS True, if you want to use default OTP Template.
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'APP_DIRS': True,
        ...
    },
]


# Configure the SENDSMS_BACKEND (for django-sendsms integration)

SENDSMS_BACKEND = 'myapp.mysmsbackend.SmsBackend' #(defaults to 'sendsms.backends.console.SmsBackend')
SENDSMS_FROM_NUMBER = "+XXxxxxxxxxxx"
SENDSMS_ACCOUNT_SID = 'ACXXXXXXXXXXXXXX'
SENDSMS_AUTH_TOKEN = 'xxxxxxxx'

Adding to URLs

Add the Below urls.py

urlpatterns = [
    url(r'^phone_login/', include('phone_login.urls', namespace='phone_login'),),
]

Customizable Fields in Settings.

PHONE_LOGIN_ATTEMPTS = 10
PHONE_LOGIN_OTP_LENGTH = 6
PHONE_LOGIN_OTP_HASH_ALGORITHM = 'sha256'

Flow

  1. User enter the phone_number and sends request to generate secret code.

  2. django-phone-login sends a secret_code as SMS to the phone number.

  3. User sends secret_code to the server to verify.

  4. django-phone-login verifies and send token as response using DRF3.

Why use django-phone-login?

  • Phone number login, no password required.

  • Registration through phone number.

  • Mobile based user authentication.

Metadata

Release files for django-phone-login 1.1.3

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-login 1.1.3
File Size Uploaded Provenance Actions
django-phone-login-1.1.3.tar.gz 9.1 kB Without provenance Details for django-phone-login-1.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-phone-login 1.1.3
File Interpreter ABI Platform Actions
django_phone_login-1.1.3-py3-none-any.whl Python 3 none any Details for django_phone_login-1.1.3-py3-none-any.whl

Total release size: 32.9 kB

Release files / django-phone-login-1.1.3.tar.gz

Download URL django-phone-login-1.1.3.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
85a6acc9aec1662e677926e1921e83413a8dd1784824754168ccd5b62bf86a10
BLAKE2b-256 checksum
How to use checksums
b9dbc11a93096b3bf60ca9a8154e94eeac8033aa917288a0aac9df221f07743f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_phone_login-1.1.3-py3-none-any.whl

Download URL django_phone_login-1.1.3-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ae1078aa65f46c98fc25627eb5636fdbf2317b47e0674aa073f9517d1a00c54
BLAKE2b-256 checksum
How to use checksums
bb10474d62c9098dabea824b23381bd6698b546cffa230bfd5fcd16a5e7547c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-phone-login 1.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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