My recommendation:
- 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/21839>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0
Comment:
The default user model will not change like this, it is too backwards
incompatible. A setting to control it is not sufficient - it's further
reaching than you initially imagine.
There is an intention of introducing `django.contrib.emailauth` module to
provide an out of the box solution. This is ticket #20824. In the mean
time there are third party applications which provide this.
--
Ticket URL: <https://code.djangoproject.com/ticket/21839#comment:1>
Comment (by russellm):
… and in the meantime, if you want email based authentication (or any
other custom User requirements for that matter), you can define and use
your own
[https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a
-custom-user-model custom User model]. The docs even contain
[https://docs.djangoproject.com/en/dev/topics/auth/customizing/#a-full-
example a worked example for an email-based user.]
--
Ticket URL: <https://code.djangoproject.com/ticket/21839#comment:2>