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
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. https://dash.plot.ly/sharing-state-between-callbacks 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)
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: https://github.com/plotly/dash/blob/3dfa941fbba79efafc397360520f5a8e964236f6/dash/dash.py#L164-L165)
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