This helped alot and solved the issue.
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, s
On Fri, Jun 14, 2013 at 3:29 PM, shashank sandela
wrote:
> As you can see in the views.py I did import the class
> EmailOrUsernameModelBackend.
OK. But you mustn't import that class, you must allow django to import
it itself, and then django will use it when authenticating users.
You do this by
Sorry. The error was:
AttributeError at /authentication/
'User' object has no attribute 'backend'
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users
As you can see in the views.py I did import the class *
EmailOrUsernameModelBackend.*
*
*
Now when I used " *user =
EmailOrUsernameModelBackend().authenticate(username=username,
password=password) *"
It gave an error saying:
AttributeError at /tangle/auth/
'User' object has no attribute 'backen
El 14/06/2013 07:26 a.m., shashank sandela escribió:
unbound method authenticate() must be called with EmailOrUsernameModelBackend
instance as first argument (got nothing instead)
Hi. Remember that you must import a function before you call it. This is
a reference to authentication in Django
h
On Fri, Jun 14, 2013 at 12:56 PM, shashank sandela
wrote:
> Hi,
>
> I created a backends.py in my project folder.
>
> backends.py ::
>
> from django.conf import settings
> from django.contrib.auth.models import User
>
> class EmailOrUsernameModelBackend(object):
> def authenticate(self, userna
Hi,
I created a backends.py in my project folder.
backends.py ::
*from django.conf import settings*
*from django.contrib.auth.models import User*
*
*
*class EmailOrUsernameModelBackend(object):*
*def authenticate(self, username=None, password=None):*
*if '@' in username:*
*
7 matches
Mail list logo