I’m a little perplexed by this. I followed some guides for a multi-page app with a navbar. Switching between pages works fine in development, but in Heroku the callback never gets triggered when you click the links. It updates my browers URL but there’s no following callback like there is in deployment. I have to reload the app the get the page to switch (at which point the callback is getting triggered). Any help is much appreciated.
github link: GitHub - mackwn/dashdiffeq: interactive simple finite differences solver for basic diff eq. Purpose to learn Dash.
heroku app: https://dashdiffeq410.herokuapp.com/
index.py
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content')
])
@app.callback(Output('page-content','children'),
[Input('url','pathname')])
def display_page(pathname):
print('pathname:{pathname}'.format(pathname=pathname))
if pathname == '/app2del': return app2del.layout
elif pathname == '/app1dpar': return app1dpar.layout
elif pathname == '/' : return about.layout
else: return '404'
navbar.py
navbar = dbc.NavbarSimple(
children=[
dbc.NavItem(dbc.NavLink("Home", href="/")),
dbc.DropdownMenu(
children=[
#dbc.DropdownMenuItem("Apps", header=True),
dbc.DropdownMenuItem("2D Elliptical", href="/app2del"),
dbc.DropdownMenuItem("1D Parabolic", href="/app1dpar"),
],
nav=True,
in_navbar=True,
label="Apps",
),
],
brand="SM Github",
brand_href="https://github.com/mackwn/dashdiffeq",
color="primary",
dark=True,
)