forked from dandeto/Smart-Farm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
38 lines (31 loc) · 1.05 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
# Core
import dash
import dash_bootstrap_components as dbc
from flask_caching import Cache
import flask
from utils.external_assets import FONT_AWESOME #, CUSTOM_STYLE
# App Specific
from layout.layout import layout
# from utils.external_assets import FONT_AWESOME, CUSTOME_STYLE
server = flask.Flask(__name__) # define flask app.server
# Load the Dash App
app = dash.Dash(__name__,
server=server,
suppress_callback_exceptions=True,
external_stylesheets=[dbc.themes.BOOTSTRAP, FONT_AWESOME], # Potentially use: CUSTOM_STYLE too
meta_tags=[
{"name": "viewport", "content": "width=device-width, initial-scale=1"}
])
cache = Cache(app.server, config={
'CACHE_TYPE': 'filesystem',
'CACHE_DIR': 'cache-directory'
})
# Optionally could use a redis cache
"""
cache = Cache(app.server, config={
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': os.environ.get('REDIS_URL', 'redis://redis:6379')
})
"""
app.layout = layout
server = app.server # runs server on gunicorn