hrss/web/context_processor.py
2018-10-24 23:57:41 +02:00

9 lines
250 B
Python

def BASE_URL(request):
"""
Return a BASE_URL template context for the current request.
"""
if request.is_secure():
scheme = 'https://'
else:
scheme = 'http://'
return {'BASE_URL': scheme + request.get_host(), }