-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
Our usual recommendation for deployment is gunicorn
as the production server, and you set up a Procfile
or similar with:
gunicorn app:server --workers 4
But wait... what's server
? Well, you need to add another line to your app.py
(that's the module app
referred to before the colon):
app = Dash()
...
server = app.server
Ugh, a code change! Ripe for problems. Instead we could add a method to Dash, e.g. wsgi_app
which returns the flask app, and this way the Procfile
can be written as:
gunicorn app:app --workers 4
And the app
object already in your Dash app is picked up. Simpler, one fewer code change. nice. Vizro does this: https://vizro.readthedocs.io/en/stable/pages/user-guides/run/#jupyter .