from django.urls import reverse
from django.shortcuts import redirect
class AlreadyLoggedIn(object):
def dispatch(self, request, *args, **kwargs):
if request.user.is_authenticated:
return redirect(reverse('your-url'))
else:
return super(AlreadyLoggedIn, self).dispatch(request, *args, **kwargs)
class LoginFormView(AlreadyLoggedIn, FormView):
...