-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
36 lines (29 loc) · 1.09 KB
/
main.py
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
31
32
33
34
35
36
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from apps import start_page, bank_accounts, market_research, virtual_portfolio, financial_calculators
from app import app
app.layout = html.Div([
dcc.Location(pathname='/apps/start_page', id='url', refresh=False),
html.Div(id='page-content'),
])
@app.callback(Output('page-content', 'children'),
[Input('url', 'pathname')])
def display_page(pathname):
if pathname == '/apps/start_page':
return start_page.layout
elif pathname == '/apps/bank_accounts':
return bank_accounts.layout
elif pathname == '/apps/market_research':
return market_research.layout
elif pathname == '/apps/virtual_portfolio':
return virtual_portfolio.layout
elif pathname == '/apps/financial_calculators':
return financial_calculators.layout
else:
return html.H1('404 Page Not Found')
if __name__ == '__main__':
# Production
# app.server.run(debug=True, threaded=True)
# Development
app.run_server(debug=True)