On Fri, Sep 13, 2013 at 4:44 AM, Abdulaziz Alfoudari < [email protected]> wrote:
> This is a continuation of my post on > stackoverflow<http://stackoverflow.com/questions/18769729/django-removing-username-from-user-model> > . > > With the introduction of Django 1.5, it was possible to create a custom > User model which is flexible enough to have any user profile the developer > wants created. However, looking at a very common problem which is using the > email as the primary user identifier instead of username, the solution > requires copying most of Django's internal definition of AbstractUser and > that is only to remove the username field. > > A better solution in my opinion is make AbstractUser even more abstract by > removing username field, and allowing the developer to explicitly specify > the field to be used as the user identifier. This will require a tiny extra > work for those that use the current default behavior, but it will also > greatly reduce the work needed for the very common problem of using email > as the user identifier. > > Please share your thoughts and opinions on this. > The short answer: this isn't going to happen. AbstractUser is a released and documented API, so we're not in a position to change it in the way you describe without causing massive inconvenience to everyone that is using it at present (at least, I don't see an obvious way that this could be done). However, ticket #20824 describes a proposal to add an email-login analog of Django's built-in user. This would make introduction of email-based login a matter of 2 lines of configuration. This ticket is really just waiting on someone to prepare a patch… and it should be a relatively simple patch to prepare. If you're looking to get involved in Django development, this would be an easy place to start. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. For more options, visit https://groups.google.com/groups/opt_out.
