]> git.parisson.com Git - telecaster-client.git/commitdiff
try to fix local host
authoryomguy <yomguy@parisson.com>
Mon, 22 Jul 2013 11:58:24 +0000 (13:58 +0200)
committeryomguy <yomguy@parisson.com>
Mon, 22 Jul 2013 11:58:24 +0000 (13:58 +0200)
telecaster/context_processors.py

index 455995cc79d1b5d1bba950b775d464cd4222a5b6..1d00b12bf8931238d845c4534dd0aa595165f6d0 100644 (file)
@@ -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