Skip to content

lalokalabs/getotp.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GetOTP Python Library

Quickstart

Add getotp to INSTALLED_APPS settings:-

NSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "rest_framework",
    "getotp",
    ...

Add to AUTHENTICATION_BACKENDS:

AUTHENTICATION_BACKENDS = [
  "django.contrib.auth.backends.ModelBackend",
  "some.other.auth.OtherBackend",
  ...,
  "getotp.auth.GETOTPBackend",
]

Add to urls.py:-

urlpatterns = [
    path("", views.index),
    path("accounts/", include(("django.contrib.auth.urls", "auth"), namespace="auth")),
    ...
    path("getotp/", include("getotp.urls")),
    ...
]

Run migrate.

The login button should be available under https://yoursite.com/getotp/login/start/.