From 3e94db74491665e4ac721f0d0c19eaca0a3d55b4 Mon Sep 17 00:00:00 2001 From: Matt Tuchfarber Date: Thu, 12 Dec 2019 14:31:54 -0500 Subject: [PATCH] Adds optional setting to enable devstack theming The mako engine isn't able to find themed templates in devstack because the path it checks is set before we enable comprehensive theming. This Adds a settings section to comment out if you want to enable theming in devstack. --- lms/envs/devstack_docker.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lms/envs/devstack_docker.py b/lms/envs/devstack_docker.py index 83c128a267..19bada8af3 100644 --- a/lms/envs/devstack_docker.py +++ b/lms/envs/devstack_docker.py @@ -86,3 +86,22 @@ SYSTEM_WIDE_ROLE_CLASSES.extend(['system_wide_roles.SystemWideRoleAssignment']) if FEATURES['ENABLE_ENTERPRISE_INTEGRATION']: SYSTEM_WIDE_ROLE_CLASSES.extend(['enterprise.SystemWideEnterpriseUserRoleAssignment']) + +########################## THEMING ####################### +# If you want to enable theming in devstack, uncomment this section and add any relevant +# theme directories to COMPREHENSIVE_THEME_DIRS + +# We have to import the private method here because production.py calls +# derive_settings('lms.envs.production') which runs _make_mako_template_dirs with +# the settings from production, which doesn't include these theming settings. Thus, +# the templating engine is unable to find the themed templates because they don't exist +# in it's path. Re-calling derive_settings doesn't work because the settings was already +# changed from a function to a list, and it can't be derived again. + +# from .common import _make_mako_template_dirs +# ENABLE_COMPREHENSIVE_THEMING = True +# COMPREHENSIVE_THEME_DIRS = [ +# "/edx/app/edxapp/edx-platform/themes/" +# ] +# TEMPLATES[1]["DIRS"] = _make_mako_template_dirs +# derive_settings(__name__)