Closed itsnikhil closed 4 years ago
Hey Nikhil, maybe you're having the problem because you haven't included the
<backend-name>
Hi @itsnikhil , I am having exactly the same problem. Could you solve it somehow?
Hi @itsnikhil , I am having exactly the same problem. Could you solve it somehow?
Hi @ZunaedSifat, Yes I was able to fix the issue. I don't exactly remember how. I think I made the below mentioned changes. Please try it out once and let me know
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import permission_classes, api_view
@api_view(['GET'])
@permission_classes((IsAuthenticated, ))
def hello(request):
text = {'message': str(request.user)}
return Response(text)
I have my view which looks like this
curl -H "Authorization: Bearer <my-token-returned-by-posting-to-/auth/token-with-form-data>" -X GET http://localhost:8000/
The above command returns "AnonymousUser"
I am following the readme and was able to generate tokens but i am not able to "Manage Authenticated Requests"