Commits

David Chambers committed a77b444

Exposed Django settings to templates, and updated base template to ensure that Google Analytics code is not included when in debug mode.

  • Participants
  • Parent commits 5bbb9ff

Comments (0)

Files changed (2)

File templates/_base.dhtml

 			};
 			document.getElementById('wrap').appendChild(link);
 		}());
-	</script>{% endif %}{% endblock %}{% block analytics %}{% if GOOGLE_ANALYTICS_ID %}
+	</script>{% endif %}{% endblock %}{% block analytics %}{% if GOOGLE_ANALYTICS_ID and not settings.DEBUG %}
 	<script type="text/javascript">
 		var _gaq = _gaq || [];
 		_gaq.push(['_setAccount', '{{ GOOGLE_ANALYTICS_ID }}']);
 import disqus
 
 from django import http
+from django.conf import settings
 from django.core.mail import EmailMultiAlternatives, send_mail
 from django.shortcuts import render_to_response
 from django.template import RequestContext, loader
         if not key.startswith('_'):
             context[key] = value
 
+    # Django settings
+    context['settings'] = settings
+
     # set top-level category
     toplevel = Category.toplevel()