Skip to main content

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


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

File details

Details for the file django-Rest-phonenumber-confirmation-0.2.tar.gz.

File metadata

  • Download URL: django-Rest-phonenumber-confirmation-0.2.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

File hashes

Hashes for django-Rest-phonenumber-confirmation-0.2.tar.gz
Algorithm Hash digest
SHA256 f129b1df594eeae6026b4a41cdb91face7083dd8c706d01676e24bb5be74572a
MD5 4c20cf5a7a926e246f5f20feb7fc562b
BLAKE2b-256 0dab2a849b84ea4be082917a326390be02ff3011eac588707e3147128d5250f7

See more details on using hashes here.

File details

Details for the file django_Rest_phonenumber_confirmation-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_Rest_phonenumber_confirmation-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b2ac0172b4c262ccbdf42646a75e593e1eeb72095c3b40681ff2d18bce7714e
MD5 55cf70c90a621900184845f46df3ac46
BLAKE2b-256 cd7d2bbac7267a5706c738b0c101e6e7bab7edfc7c1b708a8af54d4acf57fc25

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page