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
PYPI
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
Built Distribution
Close
Hashes for django-Rest-phonenumber-confirmation-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f129b1df594eeae6026b4a41cdb91face7083dd8c706d01676e24bb5be74572a |
|
MD5 | 4c20cf5a7a926e246f5f20feb7fc562b |
|
BLAKE2b-256 | 0dab2a849b84ea4be082917a326390be02ff3011eac588707e3147128d5250f7 |
Close
Hashes for django_Rest_phonenumber_confirmation-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b2ac0172b4c262ccbdf42646a75e593e1eeb72095c3b40681ff2d18bce7714e |
|
MD5 | 55cf70c90a621900184845f46df3ac46 |
|
BLAKE2b-256 | cd7d2bbac7267a5706c738b0c101e6e7bab7edfc7c1b708a8af54d4acf57fc25 |