标签:get log ati custom self nbsp django tin check
setting配置
class CustomBackend(ModelBackend): def authenticate(self, username=None, password=None, **kwargs): try: user=UserProfile.objects.get(username=username) if user.check_password(password): #这密码是重载Mode里面的内置方法 return user except Exception as e: return None
AUTHENTICATION_BACKENDS=( ‘users.views.CustomBackend‘, ) # Application definition
这两段是用于自定义登入 邮箱和账号登入
标签:get log ati custom self nbsp django tin check
原文地址:http://www.cnblogs.com/Mjonj/p/7631886.html