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