On Sun, Dec 16, 2012 at 9:12 AM, Ian Foote <i...@feete.org> wrote: > On 15/12/12 11:18, sebastien.mor...@gmail.com wrote: > >> I've a custum user model which looks like : >> >> class User(AbstractBaseUser): >> email = models.EmailField(unique=True) >> activation_key = models.CharField(max_length=**255) >> is_active = models.BooleanField(default=**False) >> is_admin = models.BooleanField(default=**False) >> >> objects = UserManager() >> >> USERNAME_FIELD = 'username' >> >> <snip> > > >> >> The probleme is that user = authenticate(username=email, >> password=password) gives me None as return. >> According to the doc, authenticate takes an usersname, not an email as >> arg. But how can i use authenticate because my User model desn't support >> Username. >> Is there a solution with Django 1.5 ? >> >> > Have you tried changing USERNAME_FIELD to 'email'? > > Well spotted Ian -- that's clearly the problem. Sebastian; ignore my previous advice :-)
Yours, Russ Magee %-) -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.