https://www.django-rest-framework.org/api-guide/serializers/#serializers Serializers - Django REST framework www.django-rest-framework.org class PostListView(APIView): def get(self, request): posts = Post.objects.all() contents = [{"id": post.id, "title": post.title, "content": post.content, "created_at": post.created_at} for post in posts] ..