Пример #1
0
def obtain_user_from_token(request):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(request.DATA['token'])

    user_id = response[0].id

    return HttpResponse(user_id)
Пример #2
0
def obtain_user_from_token(r, token):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(token)
    user_id = response[0].id
    return Response(user_id)
Пример #3
0
def obtain_user_from_token(r, token):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(token)
    user_id = response[0].id
    return Response(user_id)