diff --git a/config/settings/base.py b/config/settings/base.py index b0e06626..3106e21f 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -440,6 +440,9 @@ AUTH_PAGE_LIMIT = env.int("AUTH_PAGE_LIMIT", default=1000) ANON_PAGE_LIMIT = env.int("ANON_PAGE_LIMIT", default=100) +DEFAULT_PAGE_SIZE = env.int("DEFAULT_PAGE_SIZE", default=25) +MAX_PAGE_SIZE = env.int("MAX_PAGE_SIZE", default=1000) + # django-extensions # ------------------------------------------------------------------------------ # https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration diff --git a/documentcloud/core/pagination.py b/documentcloud/core/pagination.py index 4b094284..7a61499a 100644 --- a/documentcloud/core/pagination.py +++ b/documentcloud/core/pagination.py @@ -68,8 +68,8 @@ def paginate_queryset(self, queryset, request, view=None): class CursorPagination(pagination.CursorPagination): ordering = "pk" - page_size = 25 - max_page_size = 1000 + page_size = settings.DEFAULT_PAGE_SIZE + max_page_size = settings.MAX_PAGE_SIZE page_size_query_param = "per_page" diff --git a/local.yml b/local.yml index 56bde586..1e9a049f 100644 --- a/local.yml +++ b/local.yml @@ -1,5 +1,3 @@ -version: '3.8' - volumes: local_postgres15_data: {} local_postgres15_data_backups: {} @@ -8,7 +6,6 @@ volumes: local_minio_data: {} services: - documentcloud_django: &django build: context: . @@ -35,7 +32,6 @@ services: aliases: - internal.api.dev.documentcloud.org - documentcloud_postgres: build: context: .