25 ms·
I think a common use case that requires a bit of hoop jumping is using an email address in place of a username. Example from the docs: https://docs.djangoprojec
by dnerdy 14y ago
I think a common use case that requires a bit of hoop jumping is using an email address in place of a username. Example from the docs: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#a-full-example https://docs.djangoproject.com/en/dev/topics/auth/customizin....
I suspect this may be the nastiness that's being referred to; this is the use case that I was hoping would be made dead simple.
With previous versions of Django I generated a random hash for use as a dummy/unguessable username, required an email address in the RegistrationForm, customized the AuthenticationForm, created a custom email authentication backend, and monkey patched User with various helper methods.
In 1.5 it looks like the AuthenticationForm will adapt to the field defined in USERNAME_FIELD[1], but a lot of work is still required. Support for easily using email address as the username (or support for easily specifying the username field in general without requiring all the other boilerplate) would probably go a long way.
[1] https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms https://docs.djangoproject.com/en/dev/topics/auth/customizin...
- jacobian 14y agoThanks, that's a good point. Hopefully we can do something about that in 1.6.