From 8a2695d1fdeace956e7518e79142e346d1433694 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 23 Jul 2025 21:31:31 +0200 Subject: WIP spectacular --- example_project/settings.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index 709fce8ea..10e82aeee 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -308,6 +308,18 @@ JOINT = " | " # not managed cautiously the dir contening these scripts is not set by default ISHTAR_SCRIPT_DIR = "" +# Open API schema configuration +ISHTAR_OPENAPI = False # allow to generate OpenAPI schema - usefull only for Ishtar editor +REST_FRAMEWORK = { + # YOUR SETTINGS + 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', +} +SPECTACULAR_SETTINGS = { + 'TITLE': 'Ishtar API', + 'VERSION': get_version(), + 'SERVE_INCLUDE_SCHEMA': False, +} + # GDPR GDPR_LOGGING = False GDPR_RETENTION_PERIOD = int(30.5 * 6) + 1 # ~ 6 month of logging @@ -367,6 +379,10 @@ except ImportError: if USE_TRANSLATION_OVERLOAD: INSTALLED_APPS.insert(0, "overload_translation") +if ISHTAR_OPENAPI: + INSTALLED_APPS.append("drf_spectacular") + + if "SECRET_KEY" not in globals(): # explicit import from the root for celery current_path = os.path.abspath(__file__) current_dir_path = os.path.dirname(current_path).split(os.sep)[-1] -- cgit v1.2.3