hrss/web/context_processor.py
2018-11-30 22:28:26 +01:00

9 lines
268 B
Python

from django.conf import settings
import urllib.parse
def BASE_URL(request):
"""
Return a BASE_URL template context for the current request.
"""
parse = urllib.parse.urlparse(settings.BASE_URL)
return {'BASE_URL': parse.scheme+"://"+parse.netloc, }