send OTP using sms to verify phone number upon first time registeration using Django and Twilio

I have a Django web app. I made registration form that is working with no issue. I want to add to it the OTP code to verify the entered phone number for only one time when the user register for the first time. (no need for login or out). So user can not sign up unless entered the sms code then the account will be created. I have my own registeration code that I do not want to change. Now, when the user fill in the form, the form will be submitted through ajax request. If there are errors, the errors will show up for user to correct them. If the form is valid, then sms will be sent to the entered phone and a new page with have the field for getting the sent code.

I want some body help me to finish the code as follow:

1- Write a custom code to generate the OTP and send it using twilio (the account is ready and tested)

2- Save the generated code in session alongside with other user model that have been validated

3- If the user submit the code form with correct OTP the account will be created and user will be active

4- If the user fail, there will be a button to send a new code if the user chose to. However, the user will be allowed to try only 3 times, if does not success, the user will be prevented from register for next 12 hours

5- If user success the account is created and user is active

NO plugin is allowed


def LMRegisterSubmitForm(request):

if [login to view URL] == 'POST' and request.is_ajax:

form = LMUserRegisterForm([login to view URL] or None)

if form.is_valid():

user = [login to view URL](commit=False)

# deactive user untill click the url sent to a user email

user.is_active = False

user.is_staff = False

user.is_superuser = False

password = form.cleaned_data['password']


# [login to view URL]()

# save new registered user's data into session

[login to view URL]['new_user_info'] = user

# to register new password into user pass word record model

# password_log = PasswordLog()

# [login to view URL] = user

# [login to view URL] = [login to view URL]

# [login to view URL]()

# send sms to the phone

data = {

'success': 'تم إنشاء الحساب بنجاح.',


data = [login to view URL](data, indent=4, sort_keys=False, default=str)

return JsonResponse(data, safe=False)


errors = dict([login to view URL])

data = {

'fail': 'لقد تعذر تسجيل حسابك، هناك بعض الأخطاء بالحقول المدخلة. يرجى تعديلها والمحاولة من جديد',

'errors': errors,


data = [login to view URL](data, indent=4, sort_keys=False, default=str)

return JsonResponse(data, safe=False)


return redirect("register")

Skills: Python, Django

About the Client:
( 41 reviews ) San Antonio, United States

Project ID: #33743484

10 freelancers are bidding on average $65 for this job

(40 Reviews)

Dear, I have read your description and I'm ready to start immediately in the mentioned budget in my bid "70$". my Approach: - create separate model for phone number(number, user, confirmed, last_confirm_trial, confir More

$70 USD in 1 day
(8 Reviews)

Hello, I have briefly read the description on; Python Django project, and I can deliver as per the requirements however I need us to discuss for more clarity on the details, deadline and budget as well. I reach out to More

$200 USD in 5 days
(6 Reviews)

Hi, I am a very talented software programmer with 13+ years of development experience (5+ years professional work experience). I am a results-oriented professional and possess experience using cutting-edge development More

$20 USD in 1 day
(4 Reviews)

Hi, Manager This project is very suit for me, python expert. I am sure I can complete this project within a day, make yo sure satisfied enough. Please contact me. Looking forward for your response. Thanks

$50 USD in 1 day
(3 Reviews)

Hey Mate! I read your job "send OTP using sms to verify phone number upon first time registeration using Django and Twilio" carefully and I can do your job perfectly. I have developed many websites and ready for you no More

$20 USD in 1 day
(0 Reviews)

Hello , I have seen your job requirements and I am sure that I can do your task efficiently in less timeline as we are a team of engineers of 3 people, each one has an experience of 5+ years we are specialized in web d More

$50 USD in 7 days
(0 Reviews)

I’ve experience with using twilio for sms and think I can complete the project for you for a reasonable price

$35 USD in 5 days
(0 Reviews)

Immediately start I have read your project description very carefully and ready to solve your task and problem immediately. I am software developer having 10+years experience in web development more then 100+ websit More

$100 USD in 2 days
(0 Reviews)

Hi, I am 4 years experienced Software Developer. I work on Python and PHP mostly and respective frameworks Django and Laravel. My other skills are - MySQL, Javascript, jQuery, JSON and Ajax. I can also convert PSD to H More

$30 USD in 3 days
(0 Reviews)