When trying to deploy a multi-page Dash app, I get the following error:
dash.exceptions.NoLayoutException: The layout was `None` at the time that `run_server` was called.
Make sure to set the `layout` attribute of your application
before running the server.
In my run_app.py
file, I explicitly set the app.layout
attribute as:
app.layout=index.layout
Where index.py
routes the app to the different pages.
There's a thread on Plotly's site discussing this as well, which suggests adding the line:
web: gunicorn index:server
to the Procfile. I'm completely new to deploying these apps, but doing some reading, it seems that this isn't applicable to deployment on Python Anywhere, so I'm a bit stuck on this.
I have a simple dash app to recreate this issue here on Github.
Any advice for getting multi-page Dash apps deployed would be greatly appreciated!