serializer.py
class UserDetailSerializer(serializers.ModelSerializer):
"""for all getting all objects of a particular user """
tags = TagListSerializerField()
author=serializers.StringRelatedField(read_only=True)
class Meta:
model = Post
fields = ('id','title','rate','author','content','review','url','tags')
views.py
class PostListUser(generics.ListAPIView, APIView):
serializer_class = UserDetailSerializer
permission_classes = [IsAuthenticated]
authentication_classes =(TokenAuthentication,JSONWebTokenAuthentication)
def get_queryset(self):
return Post.objects.filter(author=self.request.user)
urls.py
url ('^ me / $', PostListUser.as_view () ),
но когда я попытался ответить на запрос get всеми заголовками авторизации, я получил этот ответ
{
"detail": "You do not have permission to perform this action."
}