Dash suppress_callback_exceptions not working

拈花ヽ惹草 提交于 2021-02-08 15:58:08

问题


Here is how I implement it in my code. I have tried each way individually and using all of them as uncommented lines of code. No matter the combination of methods I use, I still have to manually turn suppress errors once my dashboard loads.

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.title = 'TEST'

app.config['suppress_callback_exceptions'] = True
app.config.suppress_callback_exceptions = True

I have also tried (without any luck):

app = dash.Dash(__name__, external_stylesheets=external_stylesheets,
                suppress_callback_exceptions = True)

and

import sys
class HaltCallback(Exception):
    pass

@app.server.errorhandler(HaltCallback)
def handle_error(error):
    print(error, file=sys.stderr)
    return ('', 204)

Are there any other possible ways I can try to suppress the callback exceptions? I'm making a dashboard for my boss, so I'd really like automate the error suppression upon loading it.


回答1:


Figured it out

if __name__ == '__main__':
    app.run_server(debug=False,dev_tools_ui=False,dev_tools_props_check=False)

Needed to just disable dev_tools_ui on the actual webpage



来源:https://stackoverflow.com/questions/59568510/dash-suppress-callback-exceptions-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!