summaryrefslogtreecommitdiff
path: root/example_project/settings.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-07-23 21:31:31 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-07-23 21:31:31 +0200
commit8a2695d1fdeace956e7518e79142e346d1433694 (patch)
tree18fc21d6b60945406d2ef0b8ec4a1aa20360037a /example_project/settings.py
parentda30e4a7383e769e9838b198bb431f237d56694c (diff)
downloadIshtar-8a2695d1fdeace956e7518e79142e346d1433694.tar.bz2
Ishtar-8a2695d1fdeace956e7518e79142e346d1433694.zip
WIP spectaculardevelop-5.0-spetacular
Diffstat (limited to 'example_project/settings.py')
-rw-r--r--example_project/settings.py16
1 files changed, 16 insertions, 0 deletions
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]