diff --git a/web/context_processor.py b/web/context_processor.py index deafcc0..ab06b8c 100644 --- a/web/context_processor.py +++ b/web/context_processor.py @@ -7,9 +7,10 @@ def BASE_URL(request): else: scheme = 'http://' fullhost = request.get_host() - port = fullhost.split(":")[1] + host = fullhost.split(":")[0] + port = request.get_port() if port == 80 or port == 443: - base = fullhost.split(":")[0] + base = host else: - base = fullhost + base = host+":"+port return {'BASE_URL': scheme + base, } \ No newline at end of file