forked from toddkarin/pvtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
137 lines (117 loc) · 3.57 KB
/
app.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import os
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
# external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
# app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app = dash.Dash(__name__,
external_stylesheets=[dbc.themes.BOOTSTRAP],
meta_tags=[{
'name': "google-site-verification",
'content': "S1RjgJU6ZoVdko93JeLNEnn5viVxN1cXL2me3LB9J5I",
}]
)
server = app.server
server.secret_key = os.environ.get('secret_key', 'secret')
# Allow to set callbacks before setting layout:
app.config['suppress_callback_exceptions']=True
app.title = 'PVTOOLS'
# For google analytics to work:
app.scripts.config.serve_locally = True
# Add meta tag for google search
# app.scripts.append_script({
# 'external_url': 'https://cdn.jsdelivr.net/gh/lppier/lppier.github.io/async_src.js'
# })
# app.scripts.append_script({
# 'external_url': 'https://cdn.jsdelivr.net/gh/lppier/lppier.github.io/gtag.js'
# })
#
# app.config.suppress_callback_exceptions = True
# # app.config.suppress_callback_exceptions = False
# app.css.config.serve_locally = False
# app.scripts.config.serve_locally = False
#
# import test_layout
#
# header = dbc.Container([
# dbc.Row([
# dbc.Col([
# html.Img(
# src=app.get_asset_url('LBL_Masterbrand_logo_with_Tagline-01.jpg'),
# style={'height': 50})
# ],width=4),
# dbc.Col([
# html.Img(
# src=app.get_asset_url('duramat_logo.png'),
# style={'height': 50})
# ],width=4)
#
# ],justify='between')
# ])
#
# navbar = dbc.NavbarSimple(
# children=[
# dbc.DropdownMenu(
# nav=True,
# in_navbar=True,
# label="Tools",
# children=[
# dbc.DropdownMenuItem("String Length Calculator",href='/string-length-calculator'),
# dbc.DropdownMenuItem("Photovoltaic Climate Zones"),
# dbc.DropdownMenuItem(divider=True),
# dbc.DropdownMenuItem("Documentation"),
# ],
# ),
# dbc.NavItem(dbc.NavLink("Contact", href="#")),
# ],
# brand="PVTOOLS",
# brand_href="/",
# sticky="top",
# )
#
#
#
#
# app.layout = html.Div([
# dcc.Location(id='url', refresh=False),
# html.Div(id='page-content',children=[header, navbar, home.layout])
# ])
#
#
# app.layout = html.Div([
# html.H2('Hello World'),
# dcc.Dropdown(
# id='dropdown',
# options=[{'label': i, 'value': i} for i in ['LA', 'NYC', 'MTL']],
# value='LA'
# ),
# html.Div(id='display-value')
# ])
#
# @app.callback(dash.dependencies.Output('display-value', 'children'),
# [dash.dependencies.Input('dropdown', 'value')])
# def display_value(value):
# return 'You have selected "{}"'.format(value)
if __name__ == '__main__':
app.run_server(debug=True)
# # external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
# # app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
#
# app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
# server = app.server
#
# app.layout = html.Div([
# html.H2('Hello World')
# ])
#
#
# app.config.suppress_callback_exceptions = True
#
# # app.config.suppress_callback_exceptions = False
# app.css.config.serve_locally = True
# app.scripts.config.serve_locally = False
#
#
# if __name__ == '__main__':
# app.run_server(debug=True)