Hello I need to add a new endpoint to my Dash
(Plotly) web that redirects to a URL. I want to do something like the following. My Dash app is multipage, and I want to add a new endpoint (path): /embedded-ms
that performs a redirection to a URL. When accessing this endpoint Dash app should redirect to given URL.
I have the following code that works fine:
@ms_app.app.callback(Output("page-content", "children"), Input("url", "pathname")) `
def render_page_content(pathname): `
authorized = True #TODO: Change this when better integration with DNN `
if ((pathname == "/") or (pathname == "/login/callback")): `
return heatmaps_page.page_content `
elif pathname == "/page-gestion": `
return gestion_page.page_content`
And I want to add a new condition that performs the redirection:
elif pathname == "/embedded-ms": `
return redirect("https://www.somewebsite.com/mob/bi-ms?iframe=true" )`
This does not work, however, so I’m stuck. Thanks
Cristian Munteanu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.