Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getVerCode(request):
- if (request.method == 'POST'):
- form = VerCodeForm(request.POST)
- print(form.errors)
- if (form.is_valid()):
- print('VALID')
- code = request.POST.get('verCode', '')
- print('GETVERCODE : ', verCode)
- if (code == verCode):
- pass
- return HttpResponseRedirect('/custom/GetPassword', {'form': form})
- else:
- form = VerCodeForm()
- return render_to_response('EmailVerification.html', {'form': form})
- {% load staticfiles %}
- <link rel="stylesheet" type="text/css" href="{% static 'FormStyle.css' %}" />
- {% block body %}
- <div class = "formArea"> {% csrf_token %}
- <label> Enter the verification code sent to your email account: </label>
- {{ hidden_email }}
- <div class="formFields">
- <form method="POST">
- <input type="text" name = "email" size="50"> </input>
- {{ form.verCode.errors }}
- <input type="submit" value="Submit">
- </form>
- </div>
- </div>
- {% endblock %}
- class VerCodeForm(forms.Form):
- verCode = forms.CharField(max_length = 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement