15 lines
504 B
Python
15 lines
504 B
Python
from django.contrib.auth.views import LoginView
|
|
from django.urls import reverse_lazy
|
|
from users.forms import CustomLoginForm
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
from django.utils.decorators import method_decorator
|
|
|
|
@method_decorator(csrf_exempt, name='dispatch')
|
|
class CustomLoginView(LoginView):
|
|
redirect_authenticated_user = True
|
|
authentication_form = CustomLoginForm
|
|
template_name = 'users/login.html'
|
|
|
|
def get_success_url(self):
|
|
return reverse_lazy('router')
|