In order to allow non-dict objects to be serialized set the safe parameter to False.

2021. 1. 16. 22:46파이썬/Django

def getData(reqeust) :
    data = []
    tasks = serializers.serialize('json', Gantt.objects.filter(work=2))
    data.append({ 'tasks' : tasks })
    print(data)
    return JsonResponse(data)

return JsonResponse(data, safe=False)를 하면 해결됨