title: Pagination with JsonResponse
body: <p>I'd like to add pagination to my JsonResponse. </p>
  
  <p>I'm currently using the <code>django.http.JsonResponse</code> to generate json from an elastic search API. I'd like to add a pagination feature to be included. My code is as follows:</p>
  
  <pre><code>class ResultQueryView(View):
      def get(self, request):
          resource_meta = request.GET.getlist("resource_meta")
          locations = request.GET.getlist("location")
          page = request.GET.get("page")
          logger.info("Got search query where resource_meta: {} and locations: {}".format(resource_meta, locations))
          results = resource_query(resource_meta, locations)
          resource_ids = [r["_id"] for r in results['hits']['hits']]
          resources = get_enriched_resources(request.user, Resource.objects.filter(internal_id__in=resource_ids))
          serialized = ResourceSerializer(resources, many=True)
          return JsonResponse({"resources": serialized.data})
  </code></pre>