I have created an app almost identical in structure to the multi-page app design here:
https://dash.plot.ly/urls (under “Structuring a Multi-Page App”).
The app works perfectly when I run the index.py file. However, when I try running the app.py file, nothing occurs. Also, when I deploy this app to Heroku, I get an Internal Server Error that says:
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.
I’m not sure if I need to point the app object in app.py to the index.py file, or if I need to make any other changes for deployment. The layout is set initially in index.py, so I’m guessing that the app may need to access index.py before the line ‘server=app.server’ in app.py.