Use URL query strings with single-page app

Hi @tcharland13

The functionality to pass the query strings and (and path variables) to the layout is a Pages feature.

You don’t need to create a pages folder - just set it to ""

app = Dash(__name__, use_pages=True, pages_folder="")

You can register the layout as a page like this, then display it in dash.page_container:

dash.register_page("home", layout=layout, path="/")

app.layout = html.Div(dash.page_container)

Find a full example here:

1 Like