John Smith
John Smith

Reputation: 943

Email as Username in an existing django app

I created an app where I used to require an email and a username for signup.

Now I would like to change this so that any existing users have their username changed to their email. Any new users will not see the username field upon signup, but in the backend they'd be the same.

I was thinking that I could just set the max_length to the length of email? Then in the backend, I could just set the username to the email when the user signs up. What am I missing here?

Upvotes: 0

Views: 57

Answers (1)

Zorpho
Zorpho

Reputation: 182

You probably need to change the authentication backend and then change your models. More information can be found on the django documentation website:

https://docs.djangoproject.com/en/1.10/topics/auth/customizing/

Upvotes: 4

Related Questions