示例#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
文件: views.py 项目: henry1526/sprout
def obtain_user_from_token(r, token):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(token)
    user_id = response[0].id
    return Response(user_id)