python - Django-crispy-forms AttributeError when using built in AuthenticationForm -
i'm trying use django-crispy-forms display built-in authenticationform login view in django. i'm having issues subclassing authenticationform - i'm getting attributeerror. error says 'wsgirequest' object has no attribute 'get'. here form:
class loginform(authenticationform): def __init__(self, *args, **kwargs): self.helper = formhelper() self.helper.form_tag = false self.helper.layout = layout( field('username', placeholder="username"), field('password', placeholder="password"),) super(authenticationform, self).__init__(*args, **kwargs) i think error has login view being called via redirect (i'm using @login_required decorator). have ideas on how subclass built in forms django-crispy-forms , avoid error?
it looks you've got error in form:
class loginform(authenticationform): def __init__(self, *args, **kwargs): super(loginform, self).__init__(*args, **kwargs) self.helper = formhelper() self.helper.form_tag = false self.helper.layout = layout( field('username', placeholder="username"), field('password', placeholder="password"), ) you calling super, passing parent class authenticationform not loginform.
Comments
Post a Comment