From: yomguy Date: Mon, 22 Jul 2013 11:58:24 +0000 (+0200) Subject: try to fix local host X-Git-Tag: 0.9~18 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6519ecf5123605a515f2034b38f11ce86301876c;p=telecaster-client.git try to fix local host --- diff --git a/telecaster/context_processors.py b/telecaster/context_processors.py index 455995c..1d00b12 100644 --- a/telecaster/context_processors.py +++ b/telecaster/context_processors.py @@ -75,10 +75,11 @@ def host(request): request_host = get_http_host(request) local_host = get_local_host() - if request_host.split('.')[0] == local_host.split('.')[0] or \ - request_host == '127.0.0.1' or request_host == 'localhost': - # LAN access + if request_host.split('.')[0] == local_host.split('.')[0]: ip = local_host + elif request_host == '127.0.0.1' or request_host == 'localhost': + # LAN access + ip = '127.0.0.1' else: ip = settings.ROUTER_IP