Hi,
I have a single page Dash app and I want to use the query strings to modify my layout via the URL. I can make it work for multi-page apps using the kwargs of the layout function, but for some reason it does not work for a single-page app. Is this the intended behavior?
I found a workaround to be to create a pages folder with an empty dummy.py file and register this page via the app.py with path='/', and using the layout kwarg of the register_page function. That way, my app stays “single-page”, but it still implies creating a pages folder.
I believe there should be a way to make it work with this minimal example. For now it always will print 0, whatever the query strings are:
from dash import Dash, html
app = Dash(__name__)
def layout(n=0):
return html.Div(n)
app.layout = layout
if __name__ == '__main__':
app.run()