Adding `exclude=["username"]` does nothing. Same if I replace "username" 
with "email" or "user".

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 <[email protected] 
> <javascript:>> 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?
>>
>
> https://docs.djangoproject.com/en/1.11/topics/forms/modelforms/#selecting-the-fields-to-use
>  
>
>> -- 
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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
>>  
>> <https://groups.google.com/d/msgid/django-users/4e9a3109-3dd0-4754-91f2-44731154920c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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 [email protected].
To post to this group, send email to [email protected].
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.

Reply via email to