Monday, August 29, 2011

Re: How to use email as user login name

Not very sure about what you mean, because I'm new to Django.
I did see a django snippet about this. But it seems only deal with
login. How about sign up? Because you said I can not mke username not
unique, what I should do is fill email in both username and email
field in contrib.auth.models.User, and add one more field for user
name? Is this possible?

Thank you very much.

On Aug 28, 7:46 pm, Shawn Milochik <sh...@milochik.com> wrote:
> On 08/28/2011 03:26 PM, quasar wrote:
>
> > Question is how to use email as user login name, and make user name
> > not unique? What's the best way to do that?
>
> To use e-mail as login, write your own backend (about four lines of
> code). You'll be using the 'email' field, not username, because username
> isn't long enough.
>
> You can not make username not unique if you're using
> contrib.auth.models.User, but you can populate it with whatever junk you
> want because you won't be using it for anything else.
>
> https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-bac...

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

No comments:

Post a Comment