from django.http import JsonResponse from .models import Employee from .serializers import EmployeeSerializer def read_employees(request): employees = Employee.objects.all() serializer = EmployeeSerializer(employees, many=True) return JsonResponse(serializer.data, safe=False)