Error with Gunicorn


I’m trying to deploy a dash app using nginx and gunicorn. However, when I run nginx and gunicorn with these command (dash file is

sudo /etc/rc.d/init.d/nginx start

gunicorn app:app -b localhost:8000 &

I get this error:

[2018-02-09 02:39:57 +0000] [5525] [INFO] Listening at: (5525)
[2018-02-09 02:39:57 +0000] [5525] [INFO] Using worker: sync
[2018-02-09 02:39:57 +0000] [5528] [INFO] Booting worker with pid: 5528
Application object must be callable.
[2018-02-09 02:39:58 +0000] [5528] [INFO] Worker exiting (pid: 5528)
[2018-02-09 02:39:58 +0000] [5525] [INFO] Shutting down: Master
[2018-02-09 02:39:58 +0000] [5525] [INFO] Reason: App failed to load.

I’ve tried several different python files, and they all give me this same error, even a copy and pasted dash app from the dash getting started page, so I don’t think it’s an issue with the actual dash app.

Can someone point me in the right direction? It’s probably just something small…



You need to point gunicorn at the Flask instance attached to Dash. This is not app, but rather app.server. Your command should therefore be:

gunicorn app:app.server -b localhost:8000


Thanks, this helped me

1 Like


So simple. this helped me as well thanks

Thank you ! It helped me too :heart_eyes:


This didn’t fix the same issue for me.

Firstly, I can run by using “sudo python3”. This command runs on

I tried adapting your command by using “gunicorn app:app.server -b” but it didn’t solve my issue.

I continue to get the error code of:

“Application object must be callable.”

How can this be solved?

Maybe your Dash instance inside is not called app?

The command app:app.server assumes you have a Python module with a top level attribute app that is your Dash instance. You may need to adjust accordingly.

I have a Python module with a top level attribute app that is my Dash instance. However, the command gunicorn mvp:app.server -b :8000 returns

Failed to parse ‘app.server’ as an attribute name or function call.

Unfortunately, this syntax was broken in the latest version of gunicorn (or never officially supported in the first place) - potential regression: failed to parse WSGI callable as attribute of object · Issue #2213 · benoitc/gunicorn · GitHub

So, now you have to create a variable named server inside rather than referring to it as app.server. That is, include:

app = dash.Dash(__name__)
server = app.server

It seems to be working now, thanks.

Is there another issue open related to the gunicorn and nginx configuration blocks? Even though the server seems to be running, the page goes directly to the default 404 Error page, i.e.

nginx error! The page you are looking for is not found.

Thank you in advance.

What OS is NGINX running on?

Thank you @chriddyp for the hint, I had this issue on a fresh new install, and I was clueless.

I included the:
server = app.server in my,
then started Gunicorn with:
gunicorn -w 3 run:server

And it worked. :+1: