Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getLogin(request):
- if request.user.is_authenticated:
- return redirect('index')
- else:
- if request.method == "POST":
- user = request.POST.get('user')
- password = request.POST.get('pass')
- auth = authenticate(request, username=user, password=password)
- if auth is not None:
- login(request, auth)
- return redirect('index')
- return render(request, "login.html")
Add Comment
Please, Sign In to add comment