Fixed context_processor

This commit is contained in:
Amazed 2018-11-30 22:02:41 +01:00
parent a7bbd79cf3
commit e2028bbe48

View File

@ -7,9 +7,10 @@ def BASE_URL(request):
else: else:
scheme = 'http://' scheme = 'http://'
fullhost = request.get_host() fullhost = request.get_host()
port = fullhost.split(":")[1] host = fullhost.split(":")[0]
port = request.get_port()
if port == 80 or port == 443: if port == 80 or port == 443:
base = fullhost.split(":")[0] base = host
else: else:
base = fullhost base = host+":"+port
return {'BASE_URL': scheme + base, } return {'BASE_URL': scheme + base, }