Fix not add analytics if DEBUG=True

This commit is contained in:
Andrii Marynets 2017-06-30 01:33:12 +03:00
parent 2ad984504c
commit ebf8b0646d

View file

@ -8,8 +8,7 @@ def google_analytics(request):
""" """
host = request.get_host() host = request.get_host()
ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', False).get(host) ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', False).get(host)
print(ga_prop_id) if not settings.DEBUG and ga_prop_id:
if ga_prop_id:
return { return {
'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id
} }