~homeworkprod/byceps

44457bcc5d45ff79524db235650920cdeef4114b — Jochen Kupperschmidt 3 years ago 25952cb
Only enable debug toolbar in debug mode
1 files changed, 5 insertions(+), 4 deletions(-)

M app.py
M app.py => app.py +5 -4
@@ 50,10 50,11 @@ if app.env == 'development':
    exports = dict(_generate_static_files_exports())
    app.wsgi_app = SharedDataMiddleware(app.wsgi_app, exports)

    # Enable debug toolbar.
    from flask_debugtoolbar import DebugToolbarExtension
    app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
    toolbar = DebugToolbarExtension(app)
    if app.debug:
        # Enable debug toolbar.
        from flask_debugtoolbar import DebugToolbarExtension
        app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
        toolbar = DebugToolbarExtension(app)


@app.shell_context_processor