-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
68 lines (60 loc) · 1.71 KB
/
index.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from time import time
from application import app
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
# Individual pages
from homepage import Homepage
from about import About
from blog import Blog
from portfolio import Portfolio
# Pages that didn't make it
# from missing_page import missing_page
# from time_series import graph_page, build_graph
# from landing_page import Landing_page
#
# external_stylesheets = [dbc.themes.CYBORG, '/assets/background.css']
#
# application = dash.Dash(__name__, external_stylesheets=external_stylesheets)
#
# app = application
#
# # app.enable_dev_tools(dev_tools_hot_reload=True)
#
# app.scripts.config.serve_locally = True
# app.css.config.serve_locally = True
# app.config.suppress_callback_exceptions = True
app.layout = html.Div([
dcc.Location(id = 'url',refresh = False),
html.Div(id = 'page-content')
],className="main")
#Navigation callbacks
@app.callback(Output('page-content', 'children'),
[Input('url', 'pathname')])
def display_page(pathname):
if pathname == '/about':
return About()
if pathname == '/blog':
return Blog()
if pathname == '/portfolio':
return Portfolio()
if pathname == '/auditor':
return Auditor()
if pathname == '/home':
return Homepage()
else:
return Homepage()
# @app.callback(
# Output('output', 'children'),
# [Input('pop_dropdown', 'value')]
# )
#
# def update_graph(city):
# graph = build_graph(city)
# #Graph update
# return graph
# ElasticBeanstalk looks for 'application'
application = app.server
if __name__ == '__main__':
application.run(debug=True)