User Model username field
|Reported by:||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I would love to see django officially use an email address as the username. It seems like a much more logical choice and would put an end to the constant questions appearing all over the internet regarding best practices when defining a custom user model as well as all the problems people have with it.
- Modify the default user model to allow users to authenticate using either their username or email address. This is becoming common behavior on many popular web applications.
- Make both the username and email fields optional so users aren't required to created a username.
The benefits of this would be huge for django because it would create out-of-the-box functionality that developers actually want out of the box. As it stands now, the majority of django projects created have to immediately modify this core piece of functionality and the modification trickles through the rest of their code. It would also make more sense because email addresses are, by definition, unique and could serve as the unique identifier.
At the very least, maybe just don't define a user model and leave the abstract class in place. This would at the very least not hijack the most sensible name for the user model, "User".
I know this would likely result in some backwards incompatibility issues regarding the current method of defining a custom user model but there could be a setting made to effectively make it an opt-in feature.
I'm sure this has been said before. But it just seems like the community is screaming loudly and clearly that this is an area which needs work.