Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Dash URL like /dash

$
0
0

Hi, I am looking for create a dash app with a URL like this example in flask, is it possible?

@app.route("/<tenant_name>/users")

I am using the first type file structure in the urls where each app is contained in a separate file. I would like to generate something like this, and pass this “tenant” param to dash app:

index_page = html.Div([

    html.Table([

        html.Thead(

            html.Tr([html.Th(('Dashboards'))]),

        className='thead-dark'),

        html.Tbody([

            html.Tr([html.Td(dcc.Link('Go to Page 1', href='<tenant>/apps/app1', className='alert-link'))]),

            html.Tr([html.Td(dcc.Link('Go to Page 2', href='<tenant>/apps/app2', className='alert-link'))])

        ])

    ], className='container table')

])

@app.callback(Output('page-content', 'children'),

              [Input('url', 'pathname')])

def display_page(pathname):

    if pathname == '<tenant>/apps/app1':

        return app1.layout
        #return app1.layout(<tenant>) ??? 

    elif pathname == '<tenant>/apps/app2':

        return app2.layout

    else:

        return index_page

Do I need to change to flask + dash? My app is totally dash. I am looking in the docs and did not find nothing like this yet.

Thanks for the help.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles