From cb0e2c509db8a540a09b1c9ba75676d5a2b7f0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 7 Oct 2019 16:37:01 +0200 Subject: [PATCH] De-duplicate asset settings --- .../build/openedx/settings/cms/assets.py | 17 +---------------- .../build/openedx/settings/lms/assets.py | 16 +--------------- .../build/openedx/settings/partials/assets.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 31 deletions(-) create mode 100644 tutor/templates/build/openedx/settings/partials/assets.py diff --git a/tutor/templates/build/openedx/settings/cms/assets.py b/tutor/templates/build/openedx/settings/cms/assets.py index 03b4433..914453d 100644 --- a/tutor/templates/build/openedx/settings/cms/assets.py +++ b/tutor/templates/build/openedx/settings/cms/assets.py @@ -1,21 +1,6 @@ -""" -Bare minimum settings for collecting production assets. -""" -from ..common import * -from openedx.core.lib.derived import derive_settings +{% include "build/openedx/settings/partials/assets.py" %} - -COMPREHENSIVE_THEME_DIRS.append('/openedx/themes') -STATIC_ROOT_BASE = '/openedx/staticfiles' STATIC_ROOT = path(STATIC_ROOT_BASE) / 'studio' WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json" -SECRET_KEY = 'secret' -XQUEUE_INTERFACE = { - 'django_auth': None, - 'url': None, -} -DATABASES = { - "default": {}, -} derive_settings(__name__) diff --git a/tutor/templates/build/openedx/settings/lms/assets.py b/tutor/templates/build/openedx/settings/lms/assets.py index eeb7c71..b3f85de 100644 --- a/tutor/templates/build/openedx/settings/lms/assets.py +++ b/tutor/templates/build/openedx/settings/lms/assets.py @@ -1,20 +1,6 @@ -""" -Bare minimum settings for collecting production assets. -""" -from ..common import * -from openedx.core.lib.derived import derive_settings +{% include "build/openedx/settings/partials/assets.py" %} -COMPREHENSIVE_THEME_DIRS.append('/openedx/themes') -STATIC_ROOT_BASE = '/openedx/staticfiles' STATIC_ROOT = path(STATIC_ROOT_BASE) WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json" -SECRET_KEY = 'secret' -XQUEUE_INTERFACE = { - 'django_auth': None, - 'url': None, -} -DATABASES = { - "default": {}, -} derive_settings(__name__) diff --git a/tutor/templates/build/openedx/settings/partials/assets.py b/tutor/templates/build/openedx/settings/partials/assets.py new file mode 100644 index 0000000..c36f9ce --- /dev/null +++ b/tutor/templates/build/openedx/settings/partials/assets.py @@ -0,0 +1,17 @@ +""" +Bare minimum settings for collecting production assets. +""" +from ..common import * +from openedx.core.lib.derived import derive_settings + +COMPREHENSIVE_THEME_DIRS.append('/openedx/themes') +STATIC_ROOT_BASE = '/openedx/staticfiles' + +SECRET_KEY = 'secret' +XQUEUE_INTERFACE = { + 'django_auth': None, + 'url': None, +} +DATABASES = { + "default": {}, +}