Error at Login page - TypeError: __init__() got an unexpected keyword argument 'request'

Viewed 202

I've successfully created a custom user using AbstractBaseUser and I'm now trying to create the login page using CBV LoginView as follows:

class UserLogin(LoginView):
    authentication_form = UserLoginForm
    template_name = 'registration/login.html'

I have redirected LOGIN_REDIRECT_URL as required in settings. The form I am using is as follows:

class UserLoginForm(forms.Form):
username = forms.CharField(label='username')
password = forms.CharField(widget=forms.PasswordInput)

but I keep getting thrown the error:

TypeError: __init__() got an unexpected keyword argument 'request'

Any ideas? I would guess it's to do with the way I have implemented the CBV but a quick explanation of what I am doing wrong would be greatly appreciated.

Cheers.

0 Answers
Related