summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 4c0eceaaf..8a07d5ff1 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -136,11 +136,6 @@ app.jinja_env.lstrip_blocks = True
app.jinja_env.add_extension('jinja2.ext.loopcontrols')
app.secret_key = settings['server']['secret_key']
-if not searx_debug \
- or os.environ.get("WERKZEUG_RUN_MAIN") == "true" \
- or os.environ.get('UWSGI_ORIGINAL_PROC_NAME') is not None:
- initialize_engines(settings['engines'])
-
babel = Babel(app)
rtl_locales = ['ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'fa_IR', 'glk', 'he',
@@ -1051,6 +1046,10 @@ def page_not_found(e):
def run():
+ if not searx_debug \
+ or os.environ.get("WERKZEUG_RUN_MAIN") == "true" \
+ or os.environ.get('UWSGI_ORIGINAL_PROC_NAME') is not None:
+ initialize_engines(settings['engines'])
logger.debug('starting webserver on %s:%s', settings['server']['bind_address'], settings['server']['port'])
app.run(
debug=searx_debug,