Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Description
Checklist
- I have verified that that issue exists against the
masterbranch of Django REST framework. - I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- This is not a usage question. (Those should be directed to thediscussion group instead.)
- This cannot be dealt with as a third party library. (We prefer new functionality to bein the form of third party libraries where possible.)
- I have reduced the issue to the simplest possible case.
- I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Details
This issue is intended to discuss adding aMAX_PAGE_SIZE pagination setting to theREST_FRAMEWORK settings.
The default page size for paginated results can be configured by settingPAGE_SIZE in theREST_FRAMEWORK section of the Django settings file. However, there is no setting to configure the maximum page size from the Django settings file. The django-rest-framework could benefit from having aMAX_PAGE_SIZE setting as well:
REST_FRAMEWORK = { 'PAGE_SIZE': 10, 'MAX_PAGE_SIZE': 1000, ...}Downstream issue: Thedjango-rest-framework-json-api library by default sets the maximum page size to a value of 100, which can be overridden by aJsonApiPageNumberPagination class. Using a class to configure the maximum page size, and using the Django configuration file to change the default page size is unnecessarily inconsistent. It would be preferable to be able to configure both settings in one place and to have this setting supported by the django-rest-framework library and not a dependent library.
Please let me know what you think about this feature request. I'm open to alternative solutions, and also open to submitting a pull request that modifiesthe relevant lines of the pagination module and adds documentation for the new django-rest-framework setting.