|
@@ -122,8 +122,10 @@ USE_TZ = True
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
|
REST_FRAMEWORK = {
|
|
|
+ # 设置分页默认类 ?limit=?&offset=? 更习惯使用 PageNumberPagination
|
|
|
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
|
|
|
'PAGE_SIZE': 3,
|
|
|
+ # 设置过滤默认类 SearchFilter搜索类、OrderingFilter排序类
|
|
|
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
|
|
|
'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.IsAuthenticated'],
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|