diff options
-rw-r--r-- | etc/default_settings.py | 6 | ||||
-rw-r--r-- | wqflask/runserver.py | 11 | ||||
-rw-r--r-- | wqflask/utility/logger.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/marker_regression_gn1.html | 10 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 1 |
5 files changed, 19 insertions, 11 deletions
diff --git a/etc/default_settings.py b/etc/default_settings.py index ac5dc266..08eae024 100644 --- a/etc/default_settings.py +++ b/etc/default_settings.py @@ -26,7 +26,7 @@ GN_VERSION = open("../VERSION","r").read() SQL_URI = "mysql://gn2:mysql_password@localhost/db_webqtl_s" SQLALCHEMY_DATABASE_URI = 'mysql://gn2:mysql_password@localhost/db_webqtl_s' SQLALCHEMY_POOL_RECYCLE = 3600 -GN_SERVER_URL = "http://localhost:8880/" +GN_SERVER_URL = "http://test-gn2.genenetwork.org/" # ---- Flask configuration (see website) TRAP_BAD_REQUEST_ERRORS = True @@ -37,7 +37,7 @@ SECURITY_RECOVERABLE = True SECURITY_EMAIL_SENDER = "no-reply@genenetwork.org" SECURITY_POST_LOGIN_VIEW = "/thank_you" -SERVER_PORT = 5003 +SERVER_PORT = 5003 # running on localhost SECRET_HMAC_CODE = '\x08\xdf\xfa\x93N\x80\xd9\\H@\\\x9f`\x98d^\xb4a;\xc6OM\x946a\xbc\xfc\x80:*\xebc' # ---- Behavioural settings (defaults) note that logger and log levels can @@ -45,6 +45,7 @@ SECRET_HMAC_CODE = '\x08\xdf\xfa\x93N\x80\xd9\\H@\\\x9f`\x98d^\xb4a;\xc6OM\x946a WEBSERVER_MODE = 'DEV' # Python webserver mode (DEBUG|DEV|PROD) WEBSERVER_BRANDING = None # Set the branding (nyi) WEBSERVER_DEPLOY = None # Deployment specifics (nyi) +WEBSERVER_URL = "http://localhost:"+str(SERVER_PORT)+"/" # external URL LOG_LEVEL = 'WARNING' # Logger mode (DEBUG|INFO|WARNING|ERROR|CRITICAL) LOG_LEVEL_DEBUG = '0' # logger.debugf log level (0-5, 5 = show all) @@ -72,4 +73,3 @@ LOCAL_PRIVATE_FILES = HOME+"/gn2_private_data" # private static data files PYLMM_COMMAND = str.strip(os.popen("which pylmm_redis").read()) PLINK_COMMAND = str.strip(os.popen("which plink2").read()) GEMMA_COMMAND = str.strip(os.popen("which gemma").read()) - diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 0342b7ad..adacc712 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -19,11 +19,18 @@ ENDC = '\033[0m' import os app.config['SECRET_KEY'] = os.urandom(24) -from utility.tools import WEBSERVER_MODE,get_setting_int +from utility.tools import WEBSERVER_MODE,get_setting_int,get_setting port = get_setting_int("SERVER_PORT") -logger.info("GN2 is running. Visit %shttp://localhost:%s/%s" % (BLUE,port,ENDC)) +print("GN2 API server URL is ["+BLUE+get_setting("GN_SERVER_URL")+ENDC+"]") + +import requests +page = requests.get(get_setting("GN_SERVER_URL")) +if page.status_code != 200: + raise Exception("API server not found!") + +print("GN2 is running. Visit %s[http://localhost:%s/%s](%s)" % (BLUE,str(port),ENDC,get_setting("WEBSERVER_URL"))) werkzeug_logger = logging.getLogger('werkzeug') diff --git a/wqflask/utility/logger.py b/wqflask/utility/logger.py index bacb0aa4..128706df 100644 --- a/wqflask/utility/logger.py +++ b/wqflask/utility/logger.py @@ -72,7 +72,7 @@ LOG_LEVEL_DEBUG (NYI). def warning(self,*args): """Call logging.warning for multiple args""" self.collect(self.logger.warning,*args) - self.logger.warning(self.collect(*args)) + # self.logger.warning(self.collect(*args)) def error(self,*args): """Call logging.error for multiple args""" diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html index a39da73a..7aceabee 100644 --- a/wqflask/wqflask/templates/marker_regression_gn1.html +++ b/wqflask/wqflask/templates/marker_regression_gn1.html @@ -414,9 +414,9 @@ provides_entrypoints: true }); BD.putSource({name: 'Genotype', - controlURI: "http://test-gn2.genenetwork.org/api_pre1/genotype/mouse/BXD.json", - URIBase: "http://test-gn2.genenetwork.org/api_pre1/genotype/mouse/", - tier_type: 'rqtl-genotype', + controlURI: gn_server_url+"/api_pre1/genotype/mouse/BXD.json", + URIBase: gn_server_url+"/api_pre1/genotype/mouse/", + tier_type: 'rqtl-genotype', vOffset: 8, pinned: true, transposed: true, @@ -465,7 +465,7 @@ }); BD.putSource({name: 'QTL', tier_type: 'qtl', - uri: 'http://localhost:5003/generated_text/{{csv_filename}}', + uri: '/generated_text/{{csv_filename}}', style: [{ type: 'default', style: { @@ -480,7 +480,7 @@ }], }); BD.putSource({name: 'SNP density', - jbURI: "http://test-gn2.genenetwork.org/api_pre1/snp", + jbURI: gn_server_url+"/api_pre1/snp", jbQuery: "", refetchOnZoom: true, style: [{ diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 289d2dc6..8d5eadb6 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -549,6 +549,7 @@ def marker_regression_page(): gn1_template_vars = marker_regression_gn1.MarkerRegression(result).__dict__ gn1_template_vars['json_filename'] = json_filename; gn1_template_vars['csv_filename'] = csv_filename; + gn1_template_vars['gn_server_url'] = GN_SERVER_URL; pickled_result = pickle.dumps(result, pickle.HIGHEST_PROTOCOL) logger.info("pickled result length:", len(pickled_result)) |