短跑抑制_callback_exceptions不起作用 [英] Dash suppress_callback_exceptions not working

查看:60
本文介绍了短跑抑制_callback_exceptions不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在代码中实现它的方式.我已经分别尝试了每种方式,并将它们全部用作未注释的代码行.无论我使用的是哪种方法的组合,仪表板加载后,我仍然必须手动关闭抑制错误.

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)

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.

推荐答案

弄清楚了

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

只需要在实际网页上禁用dev_tools_ui

Needed to just disable dev_tools_ui on the actual webpage

这篇关于短跑抑制_callback_exceptions不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆