✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Can't serve Dash app on Heroku

Hey all,

Loving Dash!

Struggling to deploy it though.

I followed the tutorial on the Plotly Github for deploying to Heroku. I managed to get everything uploaded, but none of the Graph components are initialising.

I’m getting the same issue as one of the github users on Issue #22:

“/_dash-update-component Failed to load resource: the server responded with a status of 403 (FORBIDDEN)”

You can see the errors ‘in action’ here

I’ve tried implementing the secret key suggestion in #22, but I don’t fully understand what to do.

Can someone help please?



1 Like

you can follow the code in my github :relaxed:

Thanks @jimmybow! I also just released an official page on this in the docs: https://plot.ly/dash/deployment

nice official docs :hugs:

@jimmybow, @chriddyp - Thanks for the help, I’m trying these out now!

1 Like

It lives!



1 Like

amazing app :open_mouth:

@jimmybow Thanks bud :slight_smile: Glad you like it!

@chriddyp - Just reading the deployment docs where you say that ‘Flask’s built-in server is not suitable for production’. Forgive my ignorance, but how would one productionise a Dash app? What alternatives to Flask are there for such a task?



For production deployment with Flask: http://flask.pocoo.org/docs/0.12/deploying/#deployment

:astonished: Amazing app @rmuir_data!

Yeah, sorry, that’s pretty confusing. All this means is that you are supposed to “run” Dash apps with another server like gunicorn. Running app.run_server() runs the Flask server which can only handle one process at a time. If you run the same app but with gunicorn like $ gunicorn the_name_of_your_dash_file:server, then it will run on multiple processes, handling multiple requests at a single time. If you deployed on heroku following those instructions then you’re running it with gunicorn and “doing it right” :slight_smile:

I’ll try to make the docs a little bit more clear. Thanks for the feedback!

@chriddyp Thanks :slight_smile:

Ahh, I understand now. Appreciate the help :slight_smile:

@alex_01 That’s really helpful, thank-you!

Can you assist me on deployin dash on heroku?