Files
edx-platform/common/djangoapps/edxmako/startup.py
Bertrand Marron efa8bd6755 Add method to clear mako template lookups
Quick and dirty fix (edxapp.startup.run is called twice, once before
loading the configuration, so the paths defined in lms.startup are
basically ignored).
2014-03-06 17:09:40 +01:00

20 lines
580 B
Python

"""
Initialize the mako template lookup
"""
from django.conf import settings
from . import add_lookup, clear_lookups
def run():
"""
Setup mako lookup directories.
IMPORTANT: This method can be called multiple times during application startup. Any changes to this method
must be safe for multiple callers during startup phase.
"""
template_locations = settings.MAKO_TEMPLATES
for namespace, directories in template_locations.items():
clear_lookups(namespace)
for directory in directories:
add_lookup(namespace, directory)