Django Phone Login: Login with OTP
Project description
Django Phone Login
This login is basically used to login via OTP using phone_number as the new field instead of using email or username as the login.
How does it work?
We use django-sendsms to the phone and OTP and Verify it. This way you can use your favorite SMS Service. You can ask the user for phone_number using Forms as authentication and login in any web browser. By sending the OTP. Second, you can use Django Rest Framework and login like how Whatsapp, Viber and many login works.
Example.
Add the Below urls.py
urlpatterns = [
url(r'^otp/', include('phone_login.urls', namespace='phone_login'),),
]
Make the following changes in the settings.py
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',
)
}
AUTH_USER_MODEL = 'phone_login.CustomUser'
AUTHENTICATION_BACKENDS = [
'phone_login.backends.phone_backend.PhoneBackend',
'django.contrib.auth.backends.ModelBackend'
]
Development
Coming Up…
Requirement
Customizable Fields in Settings.
PHONE_LOGIN_MINUTES = 10
PHONE_LOGIN_OTP_LENGTH = 6
PHONE_LOGIN_OTP_HASH_ALGORITHM = 'sha256'
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
django-phone-login-1.0.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for django_phone_login-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6ab0388a1037323b82e9470db6ad96e4255ef1c80a9745d70cc351a09bf03e1 |
|
MD5 | 1fe790f249665c129a6bb81525be0a56 |
|
BLAKE2b-256 | 683ed47d75b69c2fbca5278f9bbee966354cfa7c37e7b3a62ad3aae661211141 |