a guest Feb 4th, 2016 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def login(request):
  2.     if request.method == "POST":
  3.         username = request.POST['username']
  4.         password = request.POST['password']
  5.         user = authenticate(username=username, password=password)
  6.         if user is not None:
  7.             if user.is_active:
  8.                 login(request, user)
  9.                 redirect(games_list)
  10.             else:
  11.                 raise Exception("User not active")
  12.         else:
  13.             return render(request, 'GamesStorage/login.html', {'login_data': [username, True]})
  14.     else:
  15.         return render(request, 'GamesStorage/login.html')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand