You could use flask redirect instead. You can do this by spinning up the flask server and adding the routing, then passing the server to dash as the server.
Something like this:
from flask import Flask, redirect
from dash import Dash, html, page_container
import dash
server = Flask(__name__)
@server.route('/')
def index_redirect():
return redirect('/home')
app = Dash(__name__, server=server, use_pages=True, pages_folder='')
dash.register_page('Home', path='/home', layout='You are home')
app.layout = html.Div([page_container])
app.run()
@jinnyzor Yes I know it’s built on top of flask, but if dash pages are a thing there are certain things that are supposed to be possible to do with them. now if it’s not possible, I will ask the dash team if it’s possible to add the feature in one of the next versions.
I was only interested to know if there was a feature in dash pages that could do this, if not its not worth adding a callback for I convinced them it was not worth the trouble. but thanks.
It is published on waitress using the HttpPlatform of iis.
The URL is
http://[ipAdress]/url_base_pathname
The flask redirect worked fine when url_base_pathname was not set in dash.
However, when url_base_pathname was set, routing did not work.
I tried the following: @server.route(‘/’) @server.route(‘/[url_base_pathname]’)
By the way
I tried the implementation with dcc.Location and @callback and was able to redirect.
Thanks for the information!
Unfortunately, it seems that it is not possible to change the server name as we are planning to carpool to an existing WebAPPserver.
I will try to use dcc.Location and @callback this time.