def jwt_payload_handler(user):
    from jwt_auth import settings

    try:
        username = user.get_username()
    except __HOLE__:
        username = user.username

    return {
        'user_id': user.pk,
        'email': user.email,
        'username': username,
        'exp': datetime.utcnow() + settings.JWT_EXPIRATION_DELTA
    }
dataset/ETHPy150Open jpadilla/django-jwt-auth/jwt_auth/utils.py/jwt_payload_handler