django 重新学习 前段页面配置
Posted 喵吉欧尼酱
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了django 重新学习 前段页面配置相关的知识,希望对你有一定的参考价值。
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
这两段是用于自定义登入 邮箱和账号登入
以上是关于django 重新学习 前段页面配置的主要内容,如果未能解决你的问题,请参考以下文章