|from django.contrib.auth.backends import ModelBackend|
|from django.contrib.auth.models import User|
|def authenticate(self, **credentials):|
|if 'username' in credentials:|
|return super(EmailBackend, self).authenticate(**credentials)|
|user = User.objects.get(email=credentials.get('email'))|
All you have to do is change the
on the settings.py , i created:
AUTHENTICATION_BACKENDS = (
then, i created an app named myAutenticate. After, i created the backends.py inside the folder myAutenticate and placed the that you suggested on this gist topic.
now, i'm getting the following error message: "Error importing authentication backend myAutenticat: "No module named myAutenticat"
do i miss something?
Now i'm getting this(I swear I have researched this one enough on the internet before ask you ;) ):
Maybe you'll need:
I really appreciate.