feat: 添加分页配置
This commit is contained in:
parent
eaa37ad5c7
commit
2ce0d75c41
|
|
@ -0,0 +1,6 @@
|
|||
from rest_framework.pagination import PageNumberPagination
|
||||
|
||||
|
||||
class StandardPagination(PageNumberPagination):
|
||||
page_size_query_param = 'page_size'
|
||||
max_page_size = 100
|
||||
|
|
@ -142,8 +142,8 @@ REST_FRAMEWORK = {
|
|||
'DEFAULT_PERMISSION_CLASSES': (
|
||||
'rest_framework.permissions.IsAuthenticated',
|
||||
),
|
||||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
||||
'PAGE_SIZE': 20,
|
||||
'DEFAULT_PAGINATION_CLASS': 'config.pagination.StandardPagination',
|
||||
'PAGE_SIZE': 10,
|
||||
}
|
||||
|
||||
# JWT settings
|
||||
|
|
|
|||
Loading…
Reference in New Issue