From cb5ec0fcbe6e8462f7704b13efd9862daf0b1a92 Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Sun, 9 Feb 2025 16:03:52 +0100 Subject: [PATCH] Fix: api shema app --- backend/core/settings.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backend/core/settings.py b/backend/core/settings.py index 840f2f1..3d5f4a7 100644 --- a/backend/core/settings.py +++ b/backend/core/settings.py @@ -42,11 +42,14 @@ INSTALLED_APPS = [ # Library apps "rest_framework", "rest_framework_simplejwt", + "drf_spectacular", + "drf_spectacular_sidecar", "corsheaders", "django_celery_results", "django_celery_beat", # API apps "api", + "api.schema", "api.authentication", "api.user", "images", @@ -133,6 +136,18 @@ REST_FRAMEWORK = { "rest_framework.authentication.SessionAuthentication", "rest_framework_simplejwt.authentication.JWTAuthentication", ), + "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", +} + + +SPECTACULAR_SETTINGS = { + "TITLE": "Gallery-Archivist API", + "DESCRIPTION": "A tool for archiving online galleries", + "VERSION": "1.0.0", + "SERVE_INCLUDE_SCHEMA": False, + "SWAGGER_UI_DIST": "SIDECAR", # shorthand to use the sidecar instead + "SWAGGER_UI_FAVICON_HREF": "SIDECAR", + "REDOC_DIST": "SIDECAR", }