From ebf8b0646d7a3ca94b79307dee7406ad497a15ff Mon Sep 17 00:00:00 2001 From: Andrii Marynets Date: Fri, 30 Jun 2017 01:33:12 +0300 Subject: [PATCH] Fix not add analytics if DEBUG=True --- utils/context_processor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/context_processor.py b/utils/context_processor.py index 43c27336..740591ba 100644 --- a/utils/context_processor.py +++ b/utils/context_processor.py @@ -8,9 +8,8 @@ def google_analytics(request): """ host = request.get_host() ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', False).get(host) - print(ga_prop_id) - if ga_prop_id: + if not settings.DEBUG and ga_prop_id: return { 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id } - return {} \ No newline at end of file + return {}