jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 648 forks source link

Unable to log in with the authentication information provided #461

Open labike opened 5 years ago

labike commented 5 years ago

when i post data, i always get this msg: Unable to log in with the authentication information provided

class CustomBackend(ModelBackend):
    def authenticate(self, username=None, password=None, **kwargs):
        try:
            user = User.objects.get(Q(username=username)|Q(mobile=username))
            if user.check_password(password):
                return user
        except Exception as e:
            return None

xshot-0005

i'm follow offical website config, but don't know why not post data to API?