From b44e62cd1bc982d0c6a7695c27808a2e59287509 Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Wed, 27 May 2020 16:03:13 +0200 Subject: Added deployment features --- index.py | 7 ++++++- requirements.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.py b/index.py index 9b8db80..f309978 100644 --- a/index.py +++ b/index.py @@ -11,6 +11,7 @@ import plotly.express as px from app import app from pages import satellites, total, machines, locations, vms, dozmod +# Array of all available Pages pages = [ {'name': 'Satellites', 'link': '/', 'id': 'satellites', 'layout': satellites.layout}, {'name': 'Total', 'link': '/total', 'id': 'total', 'layout': total.layout}, @@ -20,6 +21,7 @@ pages = [ {'name': 'Dozmod', 'link': '/dozmod', 'id': 'dozmod', 'layout': dozmod.layout}, ] +# Set Graph Defaults pio.templates['custom'] = dict( layout=go.Layout( title=dict( @@ -35,7 +37,7 @@ pio.templates['custom'] = dict( ) pio.templates.default = 'custom' - +# Index Layout app.layout = html.Div([ dcc.Location(id='url', refresh=False), dbc.NavbarSimple(dark=True, color="dark", fluid=True, style={'marginBottom': '20px'}, children=[ @@ -44,6 +46,9 @@ app.layout = html.Div([ html.Div(id='page-content') ]) +# Expose Server for Deployment +server = app.server + @app.callback(Output('page-content', 'children'), [Input('url', 'pathname')]) def display_page(pathname): diff --git a/requirements.txt b/requirements.txt index 4e0e72c..0baad9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ dash-table==4.7.0 Flask==1.1.2 Flask-Compress==1.5.0 future==0.18.2 +gunicorn==20.0.4 humanize==2.4.0 itsdangerous==1.1.0 Jinja2==2.11.2 -- cgit v1.2.3-55-g7522