就是另一个不同的登陆backend. 而DJANGO会尝不同的方式,哪个成功就用哪个 authentication.py from django.contrib.auth.models import User class EmailAuthBackend(object): def authenticate(self, username=None, password=None): try: user = User.objects.get(email=username) if user.check_…