Phone number confirmation
Project description
django-Rest-phonenumber-confirmation
- A Django library for phone number confirmation with twilio with phone number validation
Quickstart
For installing django-drf-auth, just run this command in your shell
pip install django-Rest-phonenumber-confirmation
settings
INSTALLED_APPS = (
# ...
'rest_framework',
'phonenumber_field',
'phonenumber_confirmation',
)
UNIQUE_PHONE_NUMBER = True
PHONE_CONFIRMATION_EXPIRE_MINUTES = 15
PHONENUMBER_DEFAULT_REGION = "Your region code"
PHONENUMBER_DB_FORMAT = ( 'INTERNATIONAL' or 'NATIONAL' )
# YOUR TWILIO INFORMATION
TWILIO_ACCOUNT_SID = 'xxxxxxxxxxx'
TWILIO_AUTH_TOKEN = 'xxxxxxxxxxx'
TWILIO_FROM_NUMBER = 'xxxxxxxxxxx'
Dont forget do
python manage.py migrate
URLS
urlpatterns = [
# ...
path('phone-confirm/api/', include('phonenumber_confirmation.urls')),
]
API Endpoints:
CREATE PHONE NUMBER AND SEND CONFIRMATION
Method: POST
Endpoint: /phone-number/sent/
Payload:
{ "phone": "PHONE NUMBER" }
CONFIRM PHON NUMBER
Method: POST
Endpoint: /phone-number/confirmation/
Payload:
{ "pin": "PIN" }
RESEND CONFIRMATION TO PHON NUMBER
Method: POST
Endpoint: /resend/<int:phonenumber_id>/confirmation/
Param : phonenumber_id = phone number object id
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-Rest-phonenumber-confirmation-0.1.tar.gz
.
File metadata
- Download URL: django-Rest-phonenumber-confirmation-0.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | daee19b5421ff52ce68e0de707d3c676a95b1e762539d25addac334aef69aa4c |
|
MD5 | eab3cdf3323868c9321ca0f4c91f0cbb |
|
BLAKE2b-256 | 267985d4d0d0c17363e619cce82d7963cd2ef7579135401db5546531638bba44 |