From 6463cf6ce39ea8c4c1e8c95e949653e77ce60490 Mon Sep 17 00:00:00 2001
From: Jan Mach <jan.mach@cesnet.cz>
Date: Mon, 9 Mar 2020 08:41:51 +0100
Subject: [PATCH] Added example usage of EXPLAIN_TEMPLATE_LOADING configuration
 variable.

This Flask configuration is usefull for debugging Jinja template loading precedence.
---
 conf/mentat-hawat.py.conf | 3 +++
 lib/vial/config.py        | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/conf/mentat-hawat.py.conf b/conf/mentat-hawat.py.conf
index e60fbf301..0742a8133 100644
--- a/conf/mentat-hawat.py.conf
+++ b/conf/mentat-hawat.py.conf
@@ -1,6 +1,9 @@
 # Force enable the debug mode.
 #DEBUG = True
 
+# Debug template file loading precedence.
+#EXPLAIN_TEMPLATE_LOADING = True
+
 # Move the application from webserver root to different location.
 #APPLICATION_ROOT = '/mentat'
 
diff --git a/lib/vial/config.py b/lib/vial/config.py
index 16185b77d..901186491 100644
--- a/lib/vial/config.py
+++ b/lib/vial/config.py
@@ -156,6 +156,10 @@ class DevelopmentConfig(Config):  # pylint: disable=locally-disabled,too-few-pub
     DEBUG = True
     """Overwrite default :py:const:`vial.config.Config.DEBUG`."""
 
+
+    EXPLAIN_TEMPLATE_LOADING = True
+    """Debug template file loading precedence."""
+
     #---------------------------------------------------------------------------
     # Custom application configurations.
     #---------------------------------------------------------------------------
-- 
GitLab