-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
32 lines (24 loc) · 764 Bytes
/
index.py
File metadata and controls
32 lines (24 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
import nav
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content')
])
app.validation_layout = html.Div([
app1.layout, nav.layout, app.layout])
@app.callback(Output('page-content', 'children'),
[Input('url', 'pathname')])
def display_page(pathname):
if pathname in hidden_tabs:
return html.Div()
elif pathname == "/":
return nav.layout
elif pathname == '/your app location/your app name':
return app1.layout
else:
return '404'
if __name__ == '__main__':
app.run_server(host="your ip", port=8080, debug=False)