Any version of
app.run_server() should produce this warning, Dash is using a library called Flask and calling the
.run() method on the Flask app which by default uses the werkzeug development server which is similar to Python’s
http.server. While the a great library for quickly running web-server in development it is not tested for security or performance.
So what do you use instead? Popular choices are gunicorn and uWSGI .
I personally use gunicorn, so in my Dash
index.py (which is the script that launches my Dash app, otherwise replace index with the name of your script) I have the following code:
if __name__ == '__main__':
# For Development only, otherwise use gunicorn or uwsgi to launch, e.g.
# gunicorn -b 0.0.0.0:8050 index:app.server
And so I have gunicorn installed and when I want to launch via gunicorn I do the following:
gunicorn -b 0.0.0.0:8050 index:app.server
This, among other things, produces better performance.
Finally you may want to hook gunicorn/uWSGI to Apache, nginx, or IIS, these web servers lots of production stability options, directly serving and caching your resources, timeout options, and many other other things.