how do I change ‘username-password login’ to ’email-password login’ on django-registration
how do I change ‘username-password login’ to ’email-password login’ on django-registration
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t easily store emails in
django.contrib.auth.model.User‘s username field, so you’ll need a different auth backend. Put the following somewhere and add its path toAUTHENTICATION_BACKENDS. See http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authentication-backendThen, in your views, authenticate by calling
django.contrib.auth.authenticate.Two things to note:
AUTHENTICATION_BACKENDthere, especially if you want to use the Django admin.Set the username in a save method somewhere (eg in your new user form):