Black Lives Matter. Please consider donating to Black Girls Code today.

Deploy multiapp dash application on heroku

Hi,

I made a multipage dash app (entire codebase here: https://github.com/toladata-ce/TolaReports) according to the docs here(https://dash.plot.ly/urls), It’s working perfectly fine on localhost but it’s crashing every time on heroku with error.
when in procfile it’s “web: gunicorn index:server” then the error is app[web.1]: Failed to find application object ‘server’ in ‘index’
and when in procfile “web: gunicorn app:server” then error is app layout not found.

curious to know if anyone else is facing the same errors.

Thanks
Prabhant

Take a look at plotly/dash-heroku-template repository. Maybe it will help.

If problem is with layout, are you sure that your app = Dash(...) instance has app.layout set? It can not be empty, as the error states. Maybe you import app in gunicorn before the app.layout is set. Should you maybe set different import path?

Yeah i have no problem with deploying single page web apps like this but with multipage apps it’s creating a problem

This is exactly the issue: there needs to be a variable named server that is equal to server = app.server inside a file named index.py

1 Like

It worked!!! Thanks a lot :slight_smile: