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.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to