Advertisement
Guest User

Untitled

a guest
Jan 25th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. if request.method=="POST":
  2.  
  3. email=request.POST.get('email','')
  4. password = request.POST.get('password','')
  5. user = auth.authenticate(email=email,password=password)
  6. print(email)
  7. print(password)
  8. print(user)
  9. if user is not None:
  10. print("notNone")
  11. auth.login(request,user)
  12. return HttpResponseRedirect("out")
  13. else:
  14. print("None")
  15. context={
  16. "failure":"Password and e-mail did not match",
  17. }
  18. return HttpResponseRedirect("out")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement