On 14/01/10 09:51, nameless wrote:
> I am asking whether is a good solution to having 2 fields with the
> same value ( username and email ) because both are required.
> Or is there another solution ?
>   
This depends on whether you don't want distinct usernames hanging
around, or you simply want people to be able to log in using their
e-mail address.

My inclination in the latter case would be to automatically generate
usernames as random strings, but not expose them. You can then create a
custom authentication backend[0] which uses the email address in place
of the username.

Usernames are good things to have around to refer to people, as e-mail
addresses can change and usernames generally don't. If user details are
to be exposed in some way (e.g.  by activity feeds or to other users)
you want some sort of immutable identifier for each user.

Again, the approach you take depends on what you're trying to do and who
your audience is.

Alex

[0] http://docs.djangoproject.com/en/dev/ref/authbackends/
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to