from django.core import serializers

def wall_copy(request):
    posts = user_post.objects.all().order_by('id')[:20].reverse()
posts_serialized = serializers.serialize('json', posts)
Создание массива json в django