title: Django Rest Framework global pagination and pagination_class are not working
body: <p>My settings:
  </p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
      'PAGE_SIZE': 2
  }
  </code></pre>
  
  <p>My pagination Class:</p>
  
  <pre class="lang-python prettyprint-override"><code>from rest_framework.pagination import PageNumberPagination
  
  
  class CustomNumberPagination(PageNumberPagination):
      page_size = 5
  </code></pre>
  
  <p>My Testing View Class:</p>
  
  <pre class="lang-python prettyprint-override"><code>from rest_framework.pagination import PageNumberPagination
  from .pagination import CustomNumberPagination
  
  
  class Testing(generics.GenericAPIView):
  
      queryset = Testing.objects.all()
      serializer_class = TestingSerializer
      pagination_class = CustomNumberPagination
  
      def get(self, request):
          print PageNumberPagination.page_size  # 2
          print self.pagination_class.page_size  # 5
          queryset = self.get_queryset()
          serializer = self.serializer_class(queryset, many=True)
          return Response(serializer.data, status=status.HTTP_200_OK)
  </code></pre>
  
  <p>I can print out the page_size of PageNumberPagination and CustomNumberPagination in my console correctly.   </p>
  
  <p>However, passing <code>page</code> as a parameter doesn't have any effect. I couldn't get either global paginations or pagination_class in each view to work. I am not sure what went wrong, but it seems that most people did the same thing and just worked for them. I'd appreciate any suggestions for me.</p>
  
  <h2>Updates</h2>
  
  <p>Just got some inspirations from my selected answer below.</p>
  
  <p>Since I will have to write a lot of customizations in my overwritten <code>get()</code>, I just updated my <code>get()</code>:
  </p>
  
  <pre><code>from rest_framework.pagination import PageNumberPagination
  from .pagination import CustomNumberPagination
  
  
  class Testing(generics.GenericAPIView):
  
      queryset = Testing.objects.all()
      serializer_class = TestingSerializer
      pagination_class = CustomNumberPagination
  
      def get(self, request):
          queryset = self.get_queryset()
          page = self.request.query_params.get('page')
          if page is not None:
              paginate_queryset = self.paginate_queryset(queryset)
              serializer = self.serializer_class(paginate_queryset, many=True)
              return self.get_paginated_response(serializer.data)
  
          serializer = self.serializer_class(queryset, many=True)
          return Response(serializer.data)
  </code></pre>