-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
81 lines (69 loc) · 1.9 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
import dash
from dash import Dash, html, dcc, Input, Output, callback, dash_table
import dash_ag_grid as dag
import dash_auth
import dash_bootstrap_components as dbc
from dash_bootstrap_templates import load_figure_template
from credentials import credentials
from flask import Flask, session
# ===================== Initialize the app ==============================
load_figure_template("minty")
app = Dash(
__name__,
use_pages=True,
title="Amazon Dashboard",
external_stylesheets=[dbc.themes.MINTY, dbc.icons.FONT_AWESOME],
suppress_callback_exceptions=True
)
server = app.server
auth = dash_auth.BasicAuth(
app,
credentials['VALID_USERNAME_PASSWORD_PAIR'],
secret_key = credentials['DASH_SECRET_KEY']
)
# sidebar
sidebar = html.Div(
[
dbc.Row(
[html.Img(src="assets/logos/bf_logo.png", style={"height": "70px"})],
className="sidebar-logo",
),
html.Hr(),
dbc.Nav(
[
dbc.NavLink(
"Sales", href="/sales", active="exact", className='nav-sales'
),
dbc.NavLink(
"Competition",
href="/competition",
active="exact",
),
dbc.NavLink(
"Inventory", href="/inventory", active="exact"
),
dbc.NavLink(
"Payments", href="/payments", active="exact"
),
],
vertical=True,
pills=True,
),
],
className="sidebar",
)
content = html.Div(
className="page-content",
)
# layout
app.layout = html.Div(
[
dcc.Location(id="url", pathname="/sales"),
sidebar,
#content,
dash.page_container,
]
)
# ===================== Run the app ==============================
if __name__ == '__main__':
app.run(debug=True)