This commit is contained in:
chenyang
2022-07-02 08:52:08 +08:00
parent 0a244b34cc
commit 43e1402c74
6 changed files with 132 additions and 52 deletions
+7
View File
@@ -40,8 +40,15 @@ INSTALLED_APPS = [
'server',
'server_auth',
'channels',
'django_filters' # 注册过滤
]
REST_FRAMEWORK = {
# 全局过滤
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination'
}
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',