From 1bca9ad3311a55490f2b98045ff10a3c55a66f28 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Thu, 2 May 2024 11:35:28 +0500 Subject: [PATCH] improved code --- README.rst | 8 ++++++++ .../cairn/apps/superset/superset_config.py | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index e99b74a..6809585 100644 --- a/README.rst +++ b/README.rst @@ -244,7 +244,15 @@ Add/Update Superset Configurations ---------------------------------- Use ``cairn-superset-settings`` patch to add or update `Superset configurations `__. + +e.g, to customize visualizations, add following configurations in ``cairn-superset-settings`` patch:: + + APP_NAME = "" + APP_ICON = "" + APP_ICON_WIDTH = + Then apply changes with:: + tutor local launch Troubleshooting diff --git a/tutorcairn/templates/cairn/apps/superset/superset_config.py b/tutorcairn/templates/cairn/apps/superset/superset_config.py index a1fe4e9..1aa11d6 100644 --- a/tutorcairn/templates/cairn/apps/superset/superset_config.py +++ b/tutorcairn/templates/cairn/apps/superset/superset_config.py @@ -84,6 +84,12 @@ db=REDIS_CACHE_DB, key_prefix="superset_results", ) +OPENEDX_LMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" +OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}" + +if os.environ.get("FLASK_ENV") == "development": + OPENEDX_LMS_ROOT_URL = "http://{{ LMS_HOST }}:8000" + OPENEDX_CMS_ROOT_URL = "http://{{ CMS_HOST }}:8001" {% if CAIRN_ENABLE_SSO %} # Authentication @@ -91,10 +97,9 @@ # https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-oauth from flask_appbuilder.security.manager import AUTH_OAUTH AUTH_TYPE = AUTH_OAUTH -OPENEDX_LMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" + OPENEDX_SSO_CLIENT_ID = "{{ CAIRN_SSO_CLIENT_ID }}" if os.environ.get("FLASK_ENV") == "development": - OPENEDX_LMS_ROOT_URL = "http://{{ LMS_HOST }}:8000" OPENEDX_SSO_CLIENT_ID = "{{ CAIRN_SSO_CLIENT_ID }}-dev" OAUTH_PROVIDERS = [ { @@ -162,12 +167,6 @@ class CeleryConfig: # pylint: disable=too-few-public-methods "EMBEDDED_SUPERSET": True } -# Embedded Dashboard CORS -OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}" - -if os.environ.get("FLASK_ENV") == "development": - OPENEDX_CMS_ROOT_URL = "http://{{ CMS_HOST }}:8001" - ENABLE_CORS=True CORS_OPTIONS={ "origins": [