<filename>firstProject/firstApp/views.py
from django.shortcuts import render
from django.http import JsonResponse
from firstApp.models import Employee


# Create your views here.
def employeeView(request):
    data = Employee.objects.all()
    response = {'employees': list(data.values('name', 'sal'))}
    return JsonResponse(response)

<filename>firstProject/firstApp/views.py
from django.shortcuts import render
from django.http import JsonResponse
from firstApp.models import Employee


# Create your views here.
def employeeView(request):
    data = Employee.objects.all()
    response = {'employees': list(data.values('name', 'sal'))}
    return JsonResponse(response)

# Create your views here.