Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/devstack_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ Make sure that you enable the following code in ./edx-platform/lms/envs/devstack
# 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
# 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
from .common import make_mako_template_dirs
ENABLE_COMPREHENSIVE_THEMING = True
COMPREHENSIVE_THEME_DIRS = [
"/edx/app/edxapp/edx-platform/themes/",
"/edx/app/edx-themes/edx-platform/",
]
TEMPLATES[1]["DIRS"] = Derived(_make_mako_template_dirs)
TEMPLATES[1]["DIRS"] = Derived(make_mako_template_dirs)
derive_settings(__name__)

Enabling a theme
Expand Down
4 changes: 2 additions & 2 deletions provision-set-edx-theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ fi
popd

# Uncomment relevant lines in the devstack.py file
sed -i '' "s|^# from .common import _make_mako_template_dirs|from .common import _make_mako_template_dirs|" "$DEVSTACK_FILE"
sed -i '' "s|^# from .common import make_mako_template_dirs|from .common import make_mako_template_dirs|" "$DEVSTACK_FILE"
sed -i '' "s|^# ENABLE_COMPREHENSIVE_THEMING = True|ENABLE_COMPREHENSIVE_THEMING = True|" "$DEVSTACK_FILE"
sed -i '' "s|^# COMPREHENSIVE_THEME_DIRS = \[|COMPREHENSIVE_THEME_DIRS = \[|" "$DEVSTACK_FILE"
sed -i '' "s|^# \"/edx/app/edxapp/edx-platform/themes/\"| \"/edx/app/edxapp/edx-platform/themes/\",|" "$DEVSTACK_FILE"
sed -i '' "/COMPREHENSIVE_THEME_DIRS = \[/a\\
\"$THEME_DIR\",
" "$DEVSTACK_FILE"
sed -i '' "s|^# \]|]|" "$DEVSTACK_FILE"
sed -i '' "s|^# TEMPLATES\[1\]\[\"DIRS\"\] = Derived(_make_mako_template_dirs)|TEMPLATES[1][\"DIRS\"] = Derived(_make_mako_template_dirs)|" "$DEVSTACK_FILE"
sed -i '' "s|^# TEMPLATES\[1\]\[\"DIRS\"\] = Derived(make_mako_template_dirs)|TEMPLATES[1][\"DIRS\"] = Derived(make_mako_template_dirs)|" "$DEVSTACK_FILE"
sed -i '' "s|^# derive_settings(__name__)|derive_settings(__name__)|" "$DEVSTACK_FILE"


Expand Down
7 changes: 4 additions & 3 deletions py_configuration_files/lms.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,18 +484,19 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
# 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
# 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
# from .common import make_mako_template_dirs
# ENABLE_COMPREHENSIVE_THEMING = True
# COMPREHENSIVE_THEME_DIRS = [
# "/edx/src/edx-themes/edx-platform",
# "/edx/app/edxapp/edx-platform/themes/"
# ]
# TEMPLATES[1]["DIRS"] = Derived(_make_mako_template_dirs)
# TEMPLATES[1]["DIRS"] = Derived(make_mako_template_dirs)
# derive_settings(__name__)

# Uncomment the lines below if you'd like to see SQL statements in your devstack LMS log.
Expand Down