Add baseurl and secure base url, in order to use it in the template(s).

This commit is contained in:
Oliver Falk
2018-07-03 13:03:51 +02:00
parent 3d7af73a5a
commit a6cadbf1b0

View File

@@ -4,6 +4,7 @@ Default: useful variables for the base page templates.
from ipware import get_client_ip from ipware import get_client_ip
from ivatar.settings import IVATAR_VERSION, SITE_NAME, MAX_PHOTO_SIZE from ivatar.settings import IVATAR_VERSION, SITE_NAME, MAX_PHOTO_SIZE
from ivatar.settings import BASE_URL, SECURE_BASE_URL
def basepage(request): def basepage(request):
''' '''
@@ -20,4 +21,6 @@ def basepage(request):
context['site_name'] = SITE_NAME context['site_name'] = SITE_NAME
context['site_url'] = request.build_absolute_uri('/')[:-1] context['site_url'] = request.build_absolute_uri('/')[:-1]
context['max_file_size'] = MAX_PHOTO_SIZE context['max_file_size'] = MAX_PHOTO_SIZE
context['BASE_URL'] = BASE_URL
context['SECURE_BASE_URL'] = SECURE_BASE_URL
return context return context