I haven't heard of a package that does what you need. I will try to help 
you as much as possible.

I use django-registration to handle user registration. It provides a form 
named RegistrationFormUniqueEmail, this form, as its name suggests, will 
ensure that the email used is unique.

For login: implement an authentication backend that makes sure that the 
password and email match. It should look something like this:
# Overwrite the default backend to check for e-mail address 

class EmailBackend(ModelBackend):

    def authenticate(self, username=None, password=None):
        #If username is an email address, then try to pull it up
        try:
            user = User.objects.get(email__iexact=username)
        except User.DoesNotExist:
            return None

        if user.check_password(password):
            return user

Let me know if you have any questions.


On Sunday, November 4, 2012 2:09:36 AM UTC-5, Frankline wrote:
>
> Hi all,
>
> I guess this question has been asked here a couple of times but I'm going 
> to ask it anyway.
>
> I'm developing a Django application/website and I have a need to use the 
> email for authentication instead of username. I'm more keen to find out how 
> you handle the following:
>
> - The default length of the email field
> - Ensuring that the email field remain unique
> - Making/Synchronizing the changes with the database
>
> I'm more biased towards handling this myself rather than using the 
> available packages out there.
>
> Does any one have a pointer to a link on how this is handled?
>
> Thanks.
>
> Regards,
> F. O. O.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/cUq4lreToHgJ.
To post to this group, send email to django-users@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