How to change the label for username to 'username/email' in login page in Django

102 views
Skip to first unread message

Sandip Nath

unread,
Aug 30, 2019, 1:28:47 PM8/30/19
to Django users
I am building a car rental website with Django. Currently working on user authentication.The user can either use his/her username/email and password to login.It's working fine. My question is, how will I change the label for username field to "username/email" so that the user can understand that either username or email can be entered. I cannot  make changes in the login.html template because I have used there {{ form.as_p }} tag and the concerned portion in my forms.py file has:

    class LoginForm(forms.Form):
        username = forms.CharField()
        password = forms.CharField(widget=forms.PasswordInput)

I am not able to understand where to make changes. Please help.

Amitesh Sahay

unread,
Aug 30, 2019, 2:15:47 PM8/30/19
to Django users
If guess you are using HTML to create the form. So, I believe that Type  = 'Text' and Type = 'email'. May be. Please cross cehck

Regards,
Amitesh Sahay


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d67736f6-0b96-490d-8d73-bdcb476cd048%40googlegroups.com.

Joe Reitman

unread,
Aug 30, 2019, 3:26:42 PM8/30/19
to Django users
Reply all
Reply to author
Forward
0 new messages