From dd70a61b2a8159005ed49241b836d80a5c0ba64f Mon Sep 17 00:00:00 2001 From: Ian Andwati Date: Wed, 6 Mar 2024 01:21:23 +0300 Subject: [PATCH] completed swagger settings --- store/settings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/store/settings.py b/store/settings.py index 319f060..f07c6d8 100644 --- a/store/settings.py +++ b/store/settings.py @@ -63,6 +63,18 @@ INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS # JWT settings JWT_SECRET_KEY = os.environ.get("JWT_SECRET_KEY") +# Swagger ui settings +SWAGGER_SETTINGS = { + "SECURITY_DEFINITIONS": { + "Auth Token [Bearer (JWT)]": {"type": "apiKey", "name": "Authorization", "in": "header"}, + }, +} + +# Rest framework settings +REST_FRAMEWORK = { + "DEFAULT_AUTHENTICATION_CLASSES": ("authentication.backends.JWTAuthentication",), +} + MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware",