From 68d0c8e2607ccdc3573a60673ac5f01d253d73b2 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Mon, 18 Jul 2016 16:06:56 +0800 Subject: [PATCH] auto get ip in mujson_mgr.py --- mujson_mgr.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mujson_mgr.py b/mujson_mgr.py index 13142d7..1459498 100644 --- a/mujson_mgr.py +++ b/mujson_mgr.py @@ -30,6 +30,12 @@ class MuMgr(object): self.config_path = get_config().MUDB_FILE self.server_addr = get_config().SERVER_PUB_ADDR self.data = MuJsonLoader() + if self.server_addr == '127.0.0.1': + try: + import socket + self.server_addr = socket.gethostbyname(socket.gethostname()) + except: + pass def ssrlink(self, user): protocol = user.get('protocol', '')