I want to filter using token authentication..
if remove get_queryset, get all TodoList author and working at postman.
but I want to filter user like get_queryset.
todo app in views.py
class TodoList(generics.ListCreateAPIView):
serializer_class = TodoSerializer
permission_classes = ()
#queryset = Todo.objects.all()
def get_queryset(self):
return Todo.objects.filter(user=self.request.user)
def perform_create(self, serializer):
serializer.save(user=self.request.user)
and using Httpie, I get json I want!
(myvenv) D:\django\todo_project>http GET http://localhost:8000/todo/ "Authorization: Token 7681fc35d7fb9fdb20dbad65ca8220b3ca12c1e6"
HTTP/1.0 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
[
{
"content": "todo!",
"timestamp": "2018-07-11T10:06:27.710916Z",
"title": "todo!",
"updated": "2018-07-11T10:06:27.710916Z",
"user": "user3"
}
]
but using postman, error occurs..

I think when filting, authentication is not working, so user is AnnoymouseUser
How can I filter request user???