1
0
mirror of https://github.com/krislamo/DJ-BaseSite synced 2025-09-11 21:49:28 +00:00

First Commit

This commit is contained in:
2012-10-13 07:35:48 -07:00
commit 80cdb11749
33 changed files with 1385 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
class CaseInsensitiveModelBackend(ModelBackend):
def authenticate(self, username=None, password=None):
try:
user = User.objects.get(username__iexact=username)
if user.check_password(password):
return user
else:
return None
except User.DoesNotExist:
return None

View File