1
0
Fork 0
satnogs-db/db/base/context_processors.py

27 lines
803 B
Python
Raw Normal View History

from django.conf import settings
from django.template.loader import render_to_string
def analytics(request):
"""Returns analytics code."""
if settings.ENVIRONMENT == 'production':
2017-02-22 08:39:26 -07:00
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': ''}
2018-11-17 13:11:35 -07:00
def auth_block(request):
"""Displays auth links local vs auth0."""
if settings.AUTH0:
return {'auth_block': render_to_string('includes/auth_auth0.html')}
else:
return {'auth_block': render_to_string('includes/auth_local.html')}