Hello Dash Community!
Flask 1.0 was released recently This is a major version release which means that it contains breaking changes. I wanted to create this thread to document which changes in Flask 1.0 affect Dash.
Here is the official Flask 1.0 Changelog: http://flask.pocoo.org/docs/1.0/changelog/
Of those changes, these are the ones that may affect Dash users:
Python 2.6 and 3.3 are no longer supported. (pallets/meta#24)
Dash is only explicitly tested on Python 2.7 and Python 3.6, so this shouldnāt affect anyone.
The development server uses threads by default. (#2529)
Previously, dash users may have used app.run_server(threaded=True)
. This is now default. Practically speaking, this means that Dash apps can serve multiple callbacks in parallel by default. Note that in production environments, you should serve your app with gunicorn
.
This is another reminder to keep your backends stateless (no mutable global variables!) so that your apps can run seamlessly in multi-threaded or multi-process environments. Dash Documentation & User Guide | Plotly for more info.
Flask.logger has been simplified. LOGGER_NAME and LOGGER_HANDLER_POLICY config was removed. The logger is always named flask.app. The level is only set on first access, it doesnāt check Flask.debug each time. Only one format is used, not different ones depending on Flask.debug. No handlers are removed, and a handler is only added if no handlers are already configured. (#2436)
Dash doesnāt use Flask.logger
explicitly but weāve discussed how to incorporate Flask.logger
in some community threads: Suppress Dash server posts to console - #5 by nedned, Redirect Logging to File / Directory - #2 by chriddyp.
Fix incorrect JSON encoding of aware, non-UTC datetimes. (#2374)
Dash uses the plotly.utils.PlotlyJSONEncoder
, so I donāt think that Dash is affected by this change (see here: dash/dash/dash.py at 3dfa941fbba79efafc397360520f5a8e964236f6 Ā· plotly/dash Ā· GitHub)
The flask command and Flask.run() will load environment variables from .env and .flaskenv files if python-dotenv is installed. (#2416)
This doesnāt affect any existing apps, but is a nice new feature
I think thatās it. If Iām missing anything, please comment