Member-only story
Implement OTP based Authentication on Django-rest-framework for E-commerce with Knox-token
Use Django rest framework to implement one-time verification code (OTP)
7 min readJun 4, 2022
Rinu Gour TDS Editors Python Django Girls NYC Aman Kharwal
Hey Medium family ! Today we are going to Implement OTP based Authentication on Django-rest-framework for E-commerce .
Prerequisite
We only require some libraries for the Django REST framework.
- Django
- Django REST framework
- django-rest-knox
Agenda
- Frist we gone register user with
username ,email, phone number & etc.
- After Registration we will go verified
phone number
and. - If user want to login we want
phone number
from user if user is exist then we will provide OTP ,otherwise we gone provide a messageuser is not exist please register
.
Setup
We are using Virtualenv
for project environment creation and in that project.
Here I am using Windows 10, so I am going use pip
instead of pip3
for Ubuntu or other Linux distro .