OBytes django application for managing OTP (OneTruePairing) for authentication, registration and changing phone number.
Project description
OBytes Django OTP App
OTP is a Django app to conduct Web-based one true pairing, for authentication, registration and changing phone number.
Quick start
-
Install
ob_dj_otp
latest versionpip install ob_dj_otp
-
Add "ob_dj_otp" to your
INSTALLED_APPS
setting like this:
# settings.py
INSTALLED_APPS = [
...
"ob_dj_otp.core.otp",
]
# Setting Twilio as SMS Provider
OTP_PROVIDER = os.environ.get("OTP_PROVIDER", "twilio")
# Passing Twilio Verify Service-ID
OTP_TWILIO_SERVICE = os.environ.get("OTP_PROVIDER")
- Include the OTP URLs in your project urls.py like this::
# urls.py
path("otp/", include("ob_dj_otp.apis.otp.urls")),
- Run
python manage.py migrate
to create the otp models.
Extending API Serializers
OTP Verification serializer can be extended as following:
# utils.py
from ob_dj_otp.apis.otp.serializers import OTPVerifyCodeSerializer
from rest_framework import serializers
class NewOTPVerifyCodeSerializer(OTPVerifyCodeSerializer):
# write_only is required to prevent errors when reading from OTP Object for the attr
email = serializers.CharField(max_length=100, required=True, write_only=True)
class Meta:
fields = OTPVerifyCodeSerializer.Meta.fields + ("email",)
model = OTPVerifyCodeSerializer.Meta.model
# add path to Serializer to django settings
OTP_VERIFICATION_SERIALIZER = "full.path.NewOTPVerifyCodeSerializer"
Developer Guide
-
Clone github repo
git clone [url]
-
pipenv install --dev
-
pre-commit install
-
Run unit tests
pytest
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
ob-dj-otp-0.0.20.tar.gz
(59.0 kB
view details)
Built Distribution
File details
Details for the file ob-dj-otp-0.0.20.tar.gz
.
File metadata
- Download URL: ob-dj-otp-0.0.20.tar.gz
- Upload date:
- Size: 59.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 109ff386b8ce04a412caa3a1d84622f7da77b1babce3c0e3100452956c5e3773 |
|
MD5 | 97c202fbc4552b9f200bb96176883de6 |
|
BLAKE2b-256 | 5e2cd1b3a3b0f8f6100f8785f6998b48323da873f1d72fb32d910c26f80706f6 |
File details
Details for the file ob_dj_otp-0.0.20-py3-none-any.whl
.
File metadata
- Download URL: ob_dj_otp-0.0.20-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6592a4987bc61aec813b2007f6a22e1f3a18a254e4671580b44b437aed52b4c7 |
|
MD5 | 2f170c4b039faf653164fe94326e4b18 |
|
BLAKE2b-256 | 4a37974621a05109a00974f11c0064da643042186c6ad4091f33b5ca8d0e9227 |