✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Running Dash App with debug false

I am new with dash I am developing a multipage app. In one of the pages I have a Dropdown and Datepicker connected to a table and everytime I am selecting something a new tab in the browser is opened with the updated table. I assume that this behaviour is related to the debug mode.
I would like to show development of the app to my team without the app always refreshing and opening a new tab. Therefore I am trying to run the app with the debug= false but if I try to do so I get the following message:

Dash is running on http://127.0.0.1:8050/

Serving Flask app “app_multipage” (lazy loading)

  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
    Traceback (most recent call last):

File “/Users/FioranMa/Desktop/matteo/web_app/index.py”, line 54, in
app.run_server(debug=False)

File “/Users/FioranMa/webapp_vehicle/lib/python3.8/site-packages/dash/dash.py”, line 1712, in run_server
self.server.run(host=host, port=port, debug=debug, **flask_run_options)

File “/Users/FioranMa/webapp_vehicle/lib/python3.8/site-packages/flask/app.py”, line 990, in run
run_simple(host, port, self, **options)

File “/Users/FioranMa/webapp_vehicle/lib/python3.8/site-packages/werkzeug/serving.py”, line 1052, in run_simple
inner()

File “/Users/FioranMa/webapp_vehicle/lib/python3.8/site-packages/werkzeug/serving.py”, line 996, in inner
srv = make_server(

File “/Users/FioranMa/webapp_vehicle/lib/python3.8/site-packages/werkzeug/serving.py”, line 847, in make_server
return ThreadedWSGIServer(

File “/Users/FioranMa/webapp_vehicle/lib/python3.8/site-packages/werkzeug/serving.py”, line 732, in init
real_sock = socket.fromfd(fd, self.address_family, socket.SOCK_STREAM)

File “/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py”, line 543, in fromfd
nfd = dup(fd)

OSError: [Errno 9] Bad file descriptor

Someone already experienced something similar?

Hi @statoconfusionale, it seems a couple funny things are going on. Normally debug mode shouldn’t cause things to open in new tabs. Also I cannot reproduce the error you have posted. Could you post a more complete example, so that maybe I could reproduce the error? Also be sure you are using the latest version of Dash. Thanks!

Ok so, first of all, I did not have the last version of Dash. So I updated it to the latest one. Then I realized that while returning the figure layout for the table graph I had an extra figure.show() that was creating the problem of opening a new tab. So that’s actually solved now it works flawlessly with debug= True

  figure = go.Figure(data=[go.Table(
    header=dict(values=list(dff.columns),
                fill_color='#F0ECE4',
                align='center'),
                
    cells=dict(values=[dff.vin, dff.mileage, dff.timestamp, dff.vehicle_licenseplate,dff.hub_name],
               fill_color='#FFFFFF',
               align='center'))
        ])
    
    figure.update_layout(
        paper_bgcolor='rgba(0,0,0,0)',
        plot_bgcolor='rgba(0,0,0,0)')
    #figure.show()
    return figure

Now even If don’t currently need it, if I try to set debug = false I still get the same error and can’t run the app


OSError: [Errno 9] Bad file descriptor