Fix template loaders for django 1.11
authorMagnus Hagander <magnus@hagander.net>
Sun, 25 Mar 2018 14:53:46 +0000 (16:53 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sun, 25 Mar 2018 14:53:46 +0000 (16:53 +0200)
Seems django 1.11 automatically enables caching template loader, which
of course breaks the ability to make any changes to the pages of a
website without restarting it. And there is no way to turn it off other
than to explicitly configure individual loders (the logic to turn it on
in non-debug configurations is hardcoded and cannot be changed).

pgcommitfest/settings.py

index 111d118aa8b46a7d96ebae84ff0886ab9b520d38..1c1a860abea2613eb3d07df45cc690122fd5c07c 100644 (file)
@@ -100,13 +100,16 @@ ROOT_URLCONF = 'pgcommitfest.urls'
 TEMPLATES = [{
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['global_templates'],
-       'APP_DIRS': True,
        'OPTIONS': {
                'context_processors': [
                        'django.template.context_processors.request',
                        'django.contrib.auth.context_processors.auth',
                        'django.contrib.messages.context_processors.messages',
                ],
+               'loaders': [
+                       'django.template.loaders.filesystem.Loader',
+                       'django.template.loaders.app_directories.Loader',
+               ],
        },
 }]