I am getting error when calling a dash page from flask page using url_for:
werkzeug.routing.BuildError: Could not build url for endpoint ‘/app/MyDashApps’ with values [‘description’]. Did you mean ‘/app/_dash-routes’ instead?
Is there a way to pass a variable from flask to dash along with the url?
route.py is:
@AppServer.route(’/visualization/’, methods=[‘GET’, ‘POST’])
def visualization(description):
return redirect(url_for(’/app/MyDashApps’, description=description))
DashServer.layout = html.Div([ dcc.Location(id=‘url’, refresh=False), dcc.Input(id=‘description’, type=‘text’),
html.Div(id=‘page-content’) ])
@DashServer.callback(Output(‘page-content’, ‘children’),[Input(‘url’, ‘pathname’)])
def display_page(pathname):
if pathname == ‘/app/MyDashApps’:
return dashapp1.layout