-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
56 lines (44 loc) · 1.34 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
import os.path
import dash
import dash_bootstrap_components as dbc
import diskcache
import os
from flask_caching import Cache
from dash import DiskcacheManager
from environment.settings import SAP_CON_PARAMS
from dms.dms import DataManagementSystem
from utils.external_assets import FONT_AWSOME, CUSTOM_STYLE
from layout.layout import layout
from uuid import uuid4
from dash_extensions.enrich import Output, DashProxy, Input, State, MultiplexerTransform
import flask
import shutil
server = flask.Flask(__name__) # define flask app.server
callback_cache = diskcache.Cache("./cache-directory/callback_cache")
background_callback_manager = DiskcacheManager(
callback_cache, cache_by=[lambda: uuid4()], expire=60
)
app = DashProxy(
__name__,
server=server,
suppress_callback_exceptions=True,
background_callback_manager=background_callback_manager,
external_stylesheets=[
dbc.themes.BOOTSTRAP,
FONT_AWSOME,
CUSTOM_STYLE
],
meta_tags=[
{"name": "viewport", "content": "width=device-width, initial-scale=1"}
],
transforms=[MultiplexerTransform()]
)
cache = Cache(app.server, config={
'CACHE_TYPE': 'filesystem',
'CACHE_DIR': 'cache-directory'
})
log_management = DataManagementSystem()
log_management.sap_config = SAP_CON_PARAMS
log_management.clear()
app.layout = layout
server = app.server