@@ -128,6 +128,7 @@ def check_static_img_folders():
128
128
129
129
return dir_path + '/images'
130
130
131
+ app = Flask (__name__ )
131
132
132
133
def main (config_file , port , numProc , template_folder = None , debug = False ):
133
134
@@ -139,14 +140,15 @@ def main(config_file, port, numProc, template_folder=None, debug=False):
139
140
sys .stderr .write ("setting template folder to\n {}\n " .format (template_folder ))
140
141
kwargs ['template_folder' ] = template_folder
141
142
142
- app = Flask (__name__ , ** kwargs )
143
+ # app = Flask(__name__, **kwargs)
143
144
144
145
from flask import Blueprint
145
146
img_path = check_static_img_folders ()
146
147
147
148
# register an static path for images using Blueprint
148
149
images_static = Blueprint ('site' , __name__ ,
149
150
static_url_path = '/images' ,
151
+ template_folder = template_folder ,
150
152
static_folder = img_path )
151
153
app .register_blueprint (images_static )
152
154
@@ -372,4 +374,15 @@ def get_image():
372
374
return None
373
375
374
376
# run the app
375
- app .run (host = '0.0.0.0' , debug = debug , use_reloader = False , port = port , processes = numProc )
377
+ # app.run(host='0.0.0.0', debug=debug, use_reloader=False, port=port, processes=numProc)
378
+
379
+ main (config_file = '/data/browserConfig.ini' , port = 8080 , template_folder = None , numProc = 1 , debug = True , create_app = False )
380
+
381
+ if __name__ == "__main__" :
382
+ # run the app
383
+ app .run (host = '0.0.0.0' , debug = True , use_reloader = False , port = 8080 , processes = 2 )
384
+
385
+
386
+
387
+
388
+
0 commit comments