On Thu, Mar 29, 2007 at 12:42:34PM -0000, RajeshD wrote:
> The idea with the above snippet is that when you add a user, you would
> enter a valid username as well as an email address. The user can then
> login by entering either the username or the email address in the
> admin login screen. That login screen happily takes in an email
> address.

One approach I've taken to create a completely email-address-oriented
authentication system without throwing out Django's auth is to simply generate a
unique username by hashing the email address.

Unfortunately, the username is limited to 30 chars, and you need 32 characters
to save the ASCII version of an MD5 hash.  So, you need to come up with your own
hashing function.  I haven't actually come up with a guaranteed-unique function
yet, and haven't really spent much time on it.  I've generally settled on simple
textual transformations that are probably "good enough" in terms of uniqueness.

-Forest

Attachment: signature.asc
Description: Digital signature

Reply via email to