Tuesday, November 28, 2017

Re: Why does Django say my login form is invalid? How can I find out why Django thinks it is?


class LoginForm(AuthenticationForm):
 username
= forms.EmailField(label=_("Email"), max_length=254)


 
class Meta:
 model
= User
 

 fields
= ("username",)


If you use "fields = ("username")" you are restricting the fields to just that field, and the authentication form needs also password to be valid
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1e861f42-2115-4377-848c-67c59d122610%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BFDnhK4cDkWdHuGJNhj0XAaRtPgmig9rSSDbe-XhyR7v2yiKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment