Exemple #1
0
 def post(self, request):
     user = CustomAuthenticationForm(data=request.POST)
     if user.is_valid():
         login(request, user.get_user())
         return redirect('index-page')
     messages.error(request, user.error_messages)
     return redirect('login')
Exemple #2
0
 def post(self, request):
     user = CustomAuthenticationForm(data=request.POST)
     if user.is_valid():
         login(request, user.get_user())
     return redirect("the-main-page")