Dash DevTools embedded in Flask App

Hello, I would like to have the DevTools of Dash in a dashboard embedded in a Flask app.

Here is a minimal working example, where even though the Flask flag ‘debug’ is set to True,
the Dash Dev Tools icon is not shown in the dashboard.

from dash import Dash, html
import flask

server = flask.Flask(__name__)

dash_app = Dash(__name__, server = server, url_base_pathname='/dashboard/')
dash_app.layout = html.Div([html.H1('Hi there, I am Dash1')])

@server.route('/')
def hello():
    return 'hello world!'

if __name__ == "__main__":
    dash_app.server.run(host="0.0.0.0", debug=True)

Is there any way to obtain it?
Thanks for your time! :slight_smile:

[SOLVED]
As said in the documentation (Dev Tools Docs), when deploying your application with gunicorn (used by Flask as WSGI server)
you may use enable_dev_tools.

So in this case would work just adding the line:
dash_app.enable_dev_tools(debug=True)

Cheers!

1 Like