startup.py
2.98 KB
-
Make comprehensive theme work with django templates. · 9b89bd32
Comprehensive theming did not work with django templates (used by course wiki). The reason it didn't work was that in order for the theme to work, theme template folder has to be added to django template dirs setting *before* django startup. After django startup, modifying `settings.DEFAULT_TEMPLATE_ENGINE['DIRS']` has no effect, because at that point the template engine is already initialized with a copy of the template dirs list. Instead of running the theme startup code as an autostartup hook, we manually run it *before* `django.setup()`. This is fine because theme startup code doesn't have to do anything else besides modifying some settings and doesn't actually need django to be initialized.
Matjaz Gregoric committed