6π
Check out the docs for those settings:
PAGINATE_BY_PARAM
The name of a query parameter, which can be used by the client to overide the default page size to use for pagination. If set to None, clients may not override the default page size.
Simply remove that line from your settings.py and you should be fine.
UPDATE 1/7/2016:
Note that this setting is now in the process of deprecation. You can consult the pagination guide for more details.
The short version is that you should now create a custom Pagination class with the appropriate settings which you then apply to your view. The examples in linked guide should be more than helpful.
2π
Not sure how helpful that would be, but I needed to paginate a single view in my project that uses filter. what i did was
class GlobalFilter(CustomMixin):
from rest_framework.pagination import PageNumberPagination
queryset = Data.objects.all()
filter_backends = [DjangoFilterBackend]
serializer_class = FilterSerializer
filterset_class = GlobalFilterSet
pagination_class = PageNumberPagination
pagination_class.page_size = 100
Could be helpful for someone else maybe π
- Drf django rest auth how to expire or delete token?
- Python Django Asynchronous Request handling
- How to access get request data in django rest framework
- Django: time zone issue
- Django forms: how to dynamically create ModelChoiceField labels
0π
Use filter-and-pagination plugin. Is well handling Filter & Pagination feature
pip install filter-and-pagination
- Django REST Framework different depth for POST/PUT?
- Get application name in Django model
- Accessing Many to Many "through" relation fields in Formsets