From 7cb59138d5a0302662c405745c0cf948082d9127 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sat, 6 Apr 2024 10:30:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B0=D1=83=D1=82?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B8=D1=84=D0=B8=D0=BA=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D1=81=D0=B2=D0=B0=D0=B3=D0=B3=D0=B5=D1=80?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/conf/settings.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/conf/settings.py b/src/conf/settings.py index 526466c..66cd462 100644 --- a/src/conf/settings.py +++ b/src/conf/settings.py @@ -154,6 +154,33 @@ REST_FRAMEWORK = { ), } +SWAGGER_SETTINGS = { + 'DEFAULT_AUTHENTICATION': 'authorization.backends.JWTAuthentication', + 'SECURITY_DEFINITIONS': { + 'Token': { + 'type': 'apiKey', + 'in': 'header', + 'name': 'Authorization' + } + }, +} + +# access token lifetime +ACCESS_TOKEN_LIFETIME = { + 'seconds': 0, + 'minutes': 0, + 'hours': 0, + 'days': 7 +} + +# refresh token lifetime +REFRESH_TOKEN_LIFETIME = { + 'seconds': 0, + 'minutes': 0, + 'hours': 0, + 'days': 30 +} + CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache",