From 9e447433ba6db228673018ee6c0487e7805838e4 Mon Sep 17 00:00:00 2001 From: cl117 Date: Fri, 30 Aug 2024 11:55:44 -0600 Subject: [PATCH] rm debug toolbar --- flask/explorer.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/flask/explorer.py b/flask/explorer.py index 93ae178..a2a3660 100644 --- a/flask/explorer.py +++ b/flask/explorer.py @@ -17,8 +17,6 @@ from elasticsearchManager import ElasticsearchManager from logger import Logger -from flask_debugtoolbar import DebugToolbarExtension -from flask_debugtoolbar_lineprofilerpanel.profile import line_profile # Configure logging, This will affect all loggers in your application, not just the Werkzeug logger. log = logging.getLogger('werkzeug') @@ -30,26 +28,7 @@ logger_ = Logger() app = Flask(__name__) -app.config.update( - SECRET_KEY='your-secret-key', # Required for the debug toolbar - DEBUG=True, - DEBUG_TB_INTERCEPT_REDIRECTS=False, - DEBUG_TB_PROFILER_ENABLED=True, - DEBUG_TB_PANELS=[ - 'flask_debugtoolbar.panels.versions.VersionDebugPanel', - 'flask_debugtoolbar.panels.timer.TimerDebugPanel', - 'flask_debugtoolbar.panels.headers.HeaderDebugPanel', - 'flask_debugtoolbar.panels.request_vars.RequestVarsDebugPanel', - 'flask_debugtoolbar.panels.config_vars.ConfigVarsDebugPanel', - 'flask_debugtoolbar.panels.template.TemplateDebugPanel', - 'flask_debugtoolbar.panels.logger.LoggingPanel', - 'flask_debugtoolbar.panels.profiler.ProfilerDebugPanel', - 'flask_debugtoolbar_lineprofilerpanel.panels.LineProfilerPanel' - ] -) - -# Initialize the debug toolbar -toolbar = DebugToolbarExtension(app) + # Error handler @app.errorhandler(Exception) @@ -180,12 +159,10 @@ def incremental_remove_collection(): raise @app.route('/test', methods=['GET']) -@line_profile def SBOLExplore_test_endpoint(): return render_template('index.html') @app.route('/', methods=['GET']) -@line_profile def sparql_search_endpoint(): try: es = elasticsearch_manager.get_es() @@ -231,4 +208,4 @@ def search_by_string(): raise if __name__ == "__main__": - app.run(debug=True) # threaded=True + app.run(debug=False, threaded=True) # threaded=True