Skip to main content

OBytes django application for managing OTP (OneTruePairing) for authentication, registration and changing phone number.

Project description

OBytes Django OTP App

Build & Test pypi license downloads python docs health-check

OTP is a Django app to conduct Web-based one true pairing, for authentication, registration and changing phone number.

Quick start

  1. Install ob_dj_otp latest version pip install ob_dj_otp

  2. 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")
  1. Include the OTP URLs in your project urls.py like this::
    # urls.py
    path("otp/", include("ob_dj_otp.apis.otp.urls")),
  1. 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

  1. Clone github repo git clone [url]

  2. pipenv install --dev

  3. pre-commit install

  4. Run unit tests pytest

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

ob-dj-otp-0.0.12.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

ob_dj_otp-0.0.12-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file ob-dj-otp-0.0.12.tar.gz.

File metadata

  • Download URL: ob-dj-otp-0.0.12.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ob-dj-otp-0.0.12.tar.gz
Algorithm Hash digest
SHA256 159e7b7ddf21070e867c469855a1fe9dab6dc6da71ee996ab37cbfc1fc5e5607
MD5 de0be3c941f2e59a0e2e7368ff78c05c
BLAKE2b-256 e1ae10454cabc469f845f422e4e09824de1f8ccc2323cfc5add3e51369a7214a

See more details on using hashes here.

File details

Details for the file ob_dj_otp-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: ob_dj_otp-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ob_dj_otp-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 42b1a9e36c6afd6112d3a2bc57cd0242e8afe5017e780454c771f3d5b22af8a2
MD5 dfbd36965ee5211dad4628b19198ac9d
BLAKE2b-256 9d3f9b8a6a9127f74381b74896bff74dcea5cbcaa791ea2fabb1fd5097de1a97

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