Thanks for the great information. I've tinkered with it and it seems to be
working pretty good. Still need to make the email unique but all in all a
pretty good solution.

What do you think about using django-registration instead? Does anybody know
of a pro/con comparison of the built-in auth versus django-registration?

On Tue, Jan 11, 2011 at 5:42 PM, Shawn Milochik <sh...@milochik.com> wrote:

> Yes, it's very easy to do.
>
> For the e-mail address as the login, all you have to do is create your own
> auth backend. That is a LOT simpler than it sounds -- just a few lines of
> code.
>
>
> http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authentication-backend
>
> As for the need to activate their account, that's very simply handled in
> your custom auth backend, since you'll be writing it anyway. Just check for
> activation status in your custom authenticate function.
>
> Here's my "custom" auth backend. It uses the e-mail address for the login.
> You'll still have to give the User instance a unique username, but then you
> can ignore it. You can copy this verbatim and be done, other than
> "activating" the account, which you can easily work out.
>
> http://dpaste.com/hold/308215/
>
> Note: If you can work with the 1.3 beta (and eventually the final release),
> then you can just use the e-mail address as the username, as they've
> expanded the allowed characters in the username field of the User model.
> Chances are you can do that, since 1.3 is scheduled for final release in a
> few weeks.
>
> Shawn
>
>
>  --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Micah Carrick, Founder

    *Green Tackle* - *Environmentally Friendly Fishing Tackle*
    www.GreenTackle.com <http://www.greentackle.com>

     Email: mi...@greentackle.com
     Phone: 971.270.2206
     Toll Free: 877.580.9165
     Fax: 503.946.3106

-- 
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