--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60ef1f71-85b3-0fad-d9b8-ad48139fb01e%40stacktrace.dk.
from django.shortcuts import render
from .models import *
from random import randint
# Create your views here.
def Index(request):
return render(request, 'myapp/index.html')
def SignupPage(request):
return render(request, 'myapp/signup.html')
def RegisterUser(request):
if request.POST['role'] == "Candidate":
role = request.POST['role'] # Master Table Field
fname = request.POST['fname'] # Candidate Table Field
lname = request.POST['lname'] # Candidate Table Field
email = request.POST['email'] # Master Table Field
password = request.POST['password'] # Master Table Field
cpassword = request.POST['cpassword']
user = UserMaster.objects.filter(email=email)
if user:
message = "User already Exist"
return render(request, "myapp/signup.html", {'msg': message})
else:
if password == cpassword:
otp = randint(100000, 999999)
newuser = UserMaster.objects.create(role=role, otp=otp, email=email, password=password)
newcand = Candidate.objects.create(user_id=newuser, firstname=fname, lastname=lname)
return render(request, "myapp/otpverify.html", {'email': email})
else:
print("Company Registration")
def OTPpage(request):
return render(request, "myapp/otpverify.html")
def OTPverify(request):
if request.method == 'POST':
email = request.POST['email']
otp = request.POST['otp']
user = UserMaster.objects.get(email=email)
if user:
if user.otp == otp:
message = "OTP Verified Successfully!!!!!"
return render(request, "myapp/login.html", {'msg': message})
else:
message = "OTP is incorrect"
return render(request, "myapp/otpverify.html", {'msg': message})
else:
return render(request, "myapp/signup.html")
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN6g9JZ26XSF%3DtQp6%2BXrwx1Av0JV%2BJsUsfkga1mnFtiBumUu8A%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com.
def OTPverify(request):
if request.method == 'POST':
email = request.POST.get['email']
otp = request.POST.get['otp']
But now it gives another error,
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4e620d00-b2c7-444e-be3f-7607b0b0a7f1n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE0sOGxjPxmRpd2CcucoeSTFuAqa1U_CBU2N7RTxZ7GLH-kTLA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN6g9Ja_j7Z08NuCLrmR5S9O1NOj_%3D8ZnG16Wd1dw0x7WSMTHQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE0sOGzW_rCgBtZaONpjU6DMzd9K90rBWsCTht2ZNGGJ6LRPrw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE0sOGzW_rCgBtZaONpjU6DMzd9K90rBWsCTht2ZNGGJ6LRPrw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cb37365e-01b6-44bf-b48c-e910ec8b20a2n%40googlegroups.com.