19 lines
545 B
Python
19 lines
545 B
Python
from django.conf import settings
|
|
from django.template.loader import render_to_string
|
|
|
|
|
|
def analytics(request):
|
|
"""Returns analytics code."""
|
|
if settings.ENVIRONMENT == 'production':
|
|
return {'analytics_code': render_to_string('includes/analytics.html')}
|
|
else:
|
|
return {'analytics_code': ''}
|
|
|
|
|
|
def stage_notice(request):
|
|
"""Displays stage notice."""
|
|
if settings.ENVIRONMENT == 'stage':
|
|
return {'stage_notice': render_to_string('includes/stage_notice.html')}
|
|
else:
|
|
return {'stage_notice': ''}
|