-
Notifications
You must be signed in to change notification settings - Fork 16
/
app.py
55 lines (43 loc) · 1.26 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
#libraries
import dash
from dash import Dash, html, dcc
import dash_bootstrap_components as dbc
from callbacks import register_callbacks
# Dash instance declaration
app = Dash(__name__, use_pages=True, external_stylesheets=[dbc.themes.FLATLY])
app.config.suppress_callback_exceptions=True
#Top menu, items get from all pages registered with plugin.pages
navbar = dbc.NavbarSimple([
dbc.NavItem(dbc.NavLink( "Inicio", href="/")),
dbc.DropdownMenu(
[
dbc.DropdownMenuItem(page["name"], href=page["path"])
for page in dash.page_registry.values()
if page["module"] != "pages.not_found_404"
],
nav=True,
label="Data Science",
),
dbc.NavItem(dbc.NavLink("Nosotros", href="/nosotros")),
],
brand="DS4A Project - Team 300",
color="primary",
dark=True,
className="mb-2",
)
#Main layout
app.layout = dbc.Container(
[
navbar,
dash.page_container
],
className="dbc",
fluid=True,
)
# Call to external function to register all callbacks
register_callbacks(app)
# This call will be used with Gunicorn server
server = app.server
# Testing server, don't use in production, host
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8050, debug=True)