]> git.parisson.com Git - telemeta.git/commitdiff
fix INSTALLED_APPS in base
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 22 Dec 2014 13:53:30 +0000 (14:53 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 22 Dec 2014 13:53:30 +0000 (14:53 +0100)
telemeta/templates/telemeta/base.html
telemeta/templatetags/telemeta_utils.py

index 9a84db3eca42c04388a6b1e30c72d2aa69db65fa..3a4a714e68b1b8710faa6e5241d20a09757e6456 100644 (file)
@@ -2,7 +2,8 @@
 {% load i18n %}
 {% load telemeta_utils %}
 {% load bootstrap3 %}
-{% if get_googletools %}
+{% settings_value 'INSTALLED_APPS' as INSTALLED_APPS %}
+{% if 'googletools' in INSTALLED_APPS %}
 {% load googletools %}
 {% endif %}
 
 <meta charset="utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 
+{% block analytics %}
+{% if 'googletools' in INSTALLED_APPS %}
+{% site_verification_code %}
+{% analytics_code %}
+{% endif %}
+{% endblock analytics %}
+
 <link rel="alternate" href="/rss" title="RSS 2.0" type="application/rss+xml" />
 
 <title>{%block head_title %}{% description %} - Telemeta{% endblock %}</title>
 </div>
 {% endblock layout %}
 
-{% block analytics %}
-{% if get_googletools %}
-{% site_verification_code %}
-{% analytics_code %}
-{% endif %}
-{% endblock analytics %}
-
 </body>
 </html>
index 8efadbbf68471bce6f6713f9fd25ccde603c0ee5..d0bf3a39633baa77c6109c8ae125807a7ea35f70 100644 (file)
@@ -464,3 +464,7 @@ def logo_url():
 def get_googletools():
     return 'googletools' in settings.INSTALLED_APPS
 
+@register.assignment_tag
+def settings_value(name):
+    return getattr(settings, name, "")
+