Django REST Framework - ListAPIView


DRF tip:

ListAPIView is used for read-only list endpoints and only accepts GET requests. It extends ListModelMixin.

class ListPost(generics.ListAPIView):
    serializer_class = PostSerializer
    queryset = Post.objects.all()

For more, review Concrete Views.