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
Metadata
Release files for django-Rest-phonenumber-confirmation 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-Rest-phonenumber-confirmation-0.2.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_Rest_phonenumber_confirmation-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 kB
Release files / django-Rest-phonenumber-confirmation-0.2.tar.gz
| Download URL | django-Rest-phonenumber-confirmation-0.2.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f129b1df594eeae6026b4a41cdb91face7083dd8c706d01676e24bb5be74572a
|
|
BLAKE2b-256 checksum How to use checksums |
0dab2a849b84ea4be082917a326390be02ff3011eac588707e3147128d5250f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / django_Rest_phonenumber_confirmation-0.2-py3-none-any.whl
| Download URL | django_Rest_phonenumber_confirmation-0.2-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b2ac0172b4c262ccbdf42646a75e593e1eeb72095c3b40681ff2d18bce7714e
|
|
BLAKE2b-256 checksum How to use checksums |
cd7d2bbac7267a5706c738b0c101e6e7bab7edfc7c1b708a8af54d4acf57fc25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|