Рефакторинг - перенос пакета utils.drf в middleware

This commit is contained in:
2026-07-19 14:33:30 +03:00
parent 1d95a70282
commit 7c13582fdb
6 changed files with 5 additions and 4 deletions

View File

@@ -5,9 +5,10 @@
# Все права защищены. Лицензия: MIT # Все права защищены. Лицензия: MIT
""" """
Пакет классов расширения Django REST Framework Пакет классов функционала среднего звена
""" """
from .custom_exception_handler import custom_exception_handler from .custom_exception_handler import custom_exception_handler
from .custom_logging_middleware import CustomLoggingMiddleware from .custom_logging_middleware import CustomLoggingMiddleware
from .expiring_token_authentication import ExpiringTokenAuthentication from .expiring_token_authentication import ExpiringTokenAuthentication

View File

@@ -37,10 +37,10 @@ REST_FRAMEWORK = {
'djangorestframework_camel_case.parser.CamelCaseJSONParser', 'djangorestframework_camel_case.parser.CamelCaseJSONParser',
), ),
'DEFAULT_AUTHENTICATION_CLASSES': [ 'DEFAULT_AUTHENTICATION_CLASSES': [
'net.xeaf.rack.utils.drf.ExpiringTokenAuthentication', 'net.xeaf.rack.middleware.ExpiringTokenAuthentication',
'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.SessionAuthentication',
], ],
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10, 'PAGE_SIZE': 10,
'EXCEPTION_HANDLER': 'net.xeaf.rack.utils.drf.custom_exception_handler' 'EXCEPTION_HANDLER': 'net.xeaf.rack.middleware.custom_exception_handler'
} }

View File

@@ -9,7 +9,7 @@
""" """
MIDDLEWARE = [ MIDDLEWARE = [
'net.xeaf.rack.utils.drf.CustomLoggingMiddleware', 'net.xeaf.rack.middleware.CustomLoggingMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',