title: Pagination based on filtered results in Django Rest Framework
body: <p>I have a simple filtering in my get function which needs to be paginated. I tried different ways of solving this issue , but I am not able to figure out what exactly needs to be done. The following is my code </p>
  
  <pre><code>class UserInfoViewSets(viewsets.ViewSet):
  
      def UserInfo_post(self,request, format=None):
          if request.method == 'POST':
              serializer = UserInfoSerializer(data=request.data)
              if serializer.is_valid():
                  serializer.save()
                  return Response(serializer.data, status=status.HTTP_201_CREATED)
              return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
      def UserInfo_get(self,request,user_token):  
          if request.method == 'GET':
              queryset = UserInfo.objects.filter(user_token=user_token)
              serializer = UserInfoSerializer(queryset,many=True)
  </code></pre>
  
  <p>I need to paginate the get results. I dont want to write a customized pagination class, but just set the parameter to limit the no of results per page. I have tried setting the following in the setting.py file </p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
      'PAGE_SIZE': 2,
  }
  </code></pre>
  
  <p>In my views file , I added ListAPIView</p>
  
  <pre><code>class UserInfoListView(generics.ListAPIView):
      model = UserInfo
      serializer_class = UserInfoSerializer
      paginate_by_param = 'limit'
  </code></pre>
  
  <p>clearly I am overlooking some minor detail. I tried scouting thought the documentation. But it seems to be geared towards people who are well versed with django.</p>