Sunday, November 26, 2017

Re: How do I limit my login form to just email and password?



On Sun, Nov 26, 2017 at 8:57 PM, Tom Tanner <dontsendemailhereok@gmail.com> wrote:
Adding `exclude=["username"]` does nothing. Same if I replace "username" with "email" or "user".

it's one or another, you either use 'include' or 'exclude'
 

On Sunday, November 26, 2017 at 2:44:44 PM UTC-5, Matemática A3K wrote:


On Sun, Nov 26, 2017 at 12:55 AM, Tom Tanner <dontsende...@gmail.com> wrote:
My `models.py` has this:
class MyUser(AbstractBaseUser):
 email
= models.CharField(max_length=254, unique=True)
 USERNAME_FIELD
= "email"

My `forms.py` has this:
class LoginForm(AuthenticationForm):
 email
= forms.EmailField(label=_("Email"), max_length=254)

 
class Meta:
  model
= MyUser
  fields
= ("email",)

The form on the template has three fields: Username, Password and Email, in that Order. I want only Email and Password to show up in the form. How do I do that?

--
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...@googlegroups.com.
To post to this group, send email to django...@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/4e9a3109-3dd0-4754-91f2-44731154920c%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/b5db6a84-e370-4ccf-8fb6-2d2486f88a60%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%2BFDnhLHisnBbVP027%2B%2Bc_h4wQT%2BZyxfNu1Uxc%3De_wan5CuosQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment