Django email authentication (weird error)
I pasted this into settings.py:
AUTHENTICATION_BACKENDS = (
'blog.auth.backends.EmailBackend',
'django.contrib.auth.backends.ModelBackend',
)
blog is the app (correctly installed), auth is the folder in the blogging app, backends.py is the file containing this method:
from django.contrib.auth.backends import ModelBackend
from django.core.validators import email_re
from django.contrib.auth.models import User
class EmailBackend(ModelBackend):
def authenticate(self, username=None, password=None):
if email_re.search(username):
try:
user = User.objects.get(email=username)
if user.check_password(password):
return user
except User.DoesNotExist:
return None
return None
My question is:
Why am I getting this error?
ImproperlyConfigured at /signup/
Error importing authentication backend auth.backends: "No module named auth.backends"
+2
a source to share