From e2028bbe4894ad6313c95241e3c1334b54f6153b Mon Sep 17 00:00:00 2001 From: HipsterCat Date: Fri, 30 Nov 2018 22:02:41 +0100 Subject: [PATCH] Fixed context_processor --- web/context_processor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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