Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. def getVerCode(request):
  2. if (request.method == 'POST'):
  3. form = VerCodeForm(request.POST)
  4. print(form.errors)
  5. if (form.is_valid()):
  6. print('VALID')
  7. code = request.POST.get('verCode', '')
  8. print('GETVERCODE : ', verCode)
  9. if (code == verCode):
  10. pass
  11. return HttpResponseRedirect('/custom/GetPassword', {'form': form})
  12. else:
  13. form = VerCodeForm()
  14. return render_to_response('EmailVerification.html', {'form': form})
  15.  
  16. {% load staticfiles %}
  17. <link rel="stylesheet" type="text/css" href="{% static 'FormStyle.css' %}" />
  18.  
  19. {% block body %}
  20. <div class = "formArea"> {% csrf_token %}
  21. <label> Enter the verification code sent to your email account: </label>
  22. {{ hidden_email }}
  23. <div class="formFields">
  24. <form method="POST">
  25. <input type="text" name = "email" size="50"> </input>
  26. {{ form.verCode.errors }}
  27. <input type="submit" value="Submit">
  28. </form>
  29. </div>
  30. </div>
  31. {% endblock %}
  32.  
  33. class VerCodeForm(forms.Form):
  34. verCode = forms.CharField(max_length = 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement