hrss/web/context_processor.py

9 lines
268 B
Python
Raw Normal View History

2018-11-30 22:28:26 +01:00
from django.conf import settings
import urllib.parse
2018-10-24 23:57:41 +02:00
def BASE_URL(request):
"""
Return a BASE_URL template context for the current request.
"""
2018-11-30 22:28:26 +01:00
parse = urllib.parse.urlparse(settings.BASE_URL)
return {'BASE_URL': parse.scheme+"://"+parse.netloc, }