I do not have a multipage application but I am attempting to use the flat project layout from URL Routing and Multiple Apps | Dash for Python Documentation | Plotly so that I can have callbacks in a separate module. To deploy this layout to Heroku I believe I need
web: gunicorn index:server
in my procfile. However, I receive the error
“”“Failed to find attribute ‘server’ in ‘index’”""
My code base is GitHub - thomasmatt88/NCAMP-dashboard: NCAMP, the National Center for Advanced Materials Performance, works with the FAA and industry partners to qualify material systems and populate a shared materials database that can be viewed publicly. This is a dashboard for viewing NCAMP materials database. where you can see I’ve attempted many deployment tests in my recent commits.
Notably, I have this block of code in my app.py file
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
server = app.server #need to add this line for heroku deployment
server.secret_key = os.environ.get('secret_key', 'secret')
app.config.suppress_callback_exceptions = True
And this block of code in my index.py file
if __name__ == '__main__':
#don't use debug = True on production server
app.run_server(debug=True)