I used the following simple code in dashapp.py file:
from logging import debug
from dash import Dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from config import appserver
import time
external_stylesheets = [dbc.themes.YETI,'./frontend/static/stylesheet.css']
dashapp = Dash(__name__, server = appserver,external_stylesheets=external_stylesheets, url_base_pathname='/application/', title='Home Page', assets_url_path='assets')
dashapp.css.config.serve_locally = True
dashapp.layout = html.Div([
html.H1('Hi Welcome to Dash-Flask integration app!'),
], id="child-process")
if __name__=='__main__':
dashapp.run_server(debug=True)
# app.py
import time
import dash
import dash_bootstrap_components as dbc
def serve_layout():
# add delay to initial layout load so we can see the spinner
time.sleep(2)
return dbc.Container(dbc.Alert("Testing"), className="p-5")
app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = serve_layout
if __name__ == "__main__":
app.run_server(debug=True)