代码:
from rest_framework.pagination import PageNumberPagination class UserPagination(PageNumberPagination): """用户分页器""" page_size = 10 # 默认的页面数据数量 page_query_param = 'page' # 定制取数据页码key page_size_query_param