def obtain_user_from_token(request): auth = TokenAuthentication() response = auth.authenticate_credentials(request.DATA['token']) user_id = response[0].id return HttpResponse(user_id)
def obtain_user_from_token(r, token): auth = TokenAuthentication() response = auth.authenticate_credentials(token) user_id = response[0].id return Response(user_id)