def get_user(self, user_id):
        """Returns a user, given his or her user id. Required for a custom authentication backend.
        Args:
            user_id
                The user id of the user to fetch.
        Returns:
            User or None
        """
        try:
            return User.objects.get(id=user_id)
        except User.DoesNotExist:
            return None
def get_user ( self , user_id ) : try : return User . objects . get ( id = user_id ) except User . DoesNotExist : return None
Returns a user, given his or her user id. Required for a custom authentication backend.
        Args:
            user_id
                The user id of the user to fetch.
        Returns:
            User or None