Several modifications are proposed in plotly/dashR#225 to support user-defined server routes in Dash for R, which will include a convenience function for URL redirects.
Following discussion with @alexcjohnson, it seems that we could make the same UI improvements within Dash for Python as well.
For example, this server.route decorator:
@server.route('/daq')
def redirect_daq():
return redirect('/dash-daq', code=301)
could be rewritten more concisely as
app.redirect('/daq', '/dash-daq')
Further, a parameterized redirect such as
@server.route('/daq/<path:subpath>')
def redirect_daq_part(subpath):
return redirect('/dash-daq/{}'.format(escape(subpath)), code=301)
... might look instead like
app.redirect('/daq/<path:subpath>', lambda subpath: '/dash-daq/{}'.format(escape(subpath)))
@Marc-Andre-Rivet
Several modifications are proposed in plotly/dashR#225 to support user-defined server routes in Dash for R, which will include a convenience function for URL redirects.
Following discussion with @alexcjohnson, it seems that we could make the same UI improvements within Dash for Python as well.
For example, this
server.routedecorator:could be rewritten more concisely as
Further, a parameterized redirect such as
... might look instead like
@Marc-Andre-Rivet