diff --git a/README.md b/README.md index 822206f..bcceed1 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,18 @@ To load initial set of tags: `python manage.py addtaxonomy` ## Endpoints + +## Pagination + +By default a `LimitOffsetPagination` pagination is enabled + +Examples: `http://127.0.0.1:8000/api/v1/products/?limit=10&offset=0` + +The response data has the following keyspayload: +``` +dict_keys(['count', 'next', 'previous', 'results']) +``` + ### User Management Creation: diff --git a/back_latienda/settings/base.py b/back_latienda/settings/base.py index 4ca6d8f..afc4c78 100644 --- a/back_latienda/settings/base.py +++ b/back_latienda/settings/base.py @@ -123,7 +123,8 @@ REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework_simplejwt.authentication.JWTAuthentication', ], - 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'] + 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'], + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', } # Internationalization