问题
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