title: Django Rest Framework Paging
body: <p>I am attempting to make my API get return a maximum of 10 per page. This helps me with infinite loading. The API url will be I am trying looks like this:</p>
  
  <pre><code>www.mysite.com/api/test/?user=5&amp;page=1
  </code></pre>
  
  <p>However, this does not work.</p>
  
  <p>I've followed the official <a href="http://www.django-rest-framework.org/api-guide/pagination/" rel="nofollow">docs here without</a> success.</p>
  
  <p>I have only modified two files, settings.py &amp; rest_views.py.</p>
  
  <p>settings.py-</p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination'
  }
  </code></pre>
  
  <p>rest_views.py-</p>
  
  <pre><code>from django.core.paginator import Paginator
  
  ...
  
  wardrobematch = {
      'user': lambda x: ('user__pk', x)  
  }
  
  class WardrobeListView(APIView):
  
      renderer_classes = (JSONRenderer, )
      paginate_by = 10
      paginate_by_param = 'page_size'
      max_paginate_by = 100
  
      def get(self, request, *args, **kwargs):
  
          filters = {}
          for key, value in request.GET.items():
              key = key.lower()
              if key in wardrobematch:
                  lookup, val = wardrobematch[key](value.lower())
                  filters[lookup] = val
  
          qset = (
              Analytic.objects
              .filter(like=True,**filters)
              .order_by('-updated',)
              # .distinct('product_id',)
              .values('product_id', 'product__name', 'product__brand', 'product__store__store_name', 'product__variation__image__image', 'product__variation__price__price',)
          )
  
          return Response(qset)
  </code></pre>