✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Multipage dash app: Error loading dependencies

Hi All, I just started using dash framework to create dashboard.I am creating multi page app. First page will ask user to enter access token and click on submit button actual Dashboard page will load up. I have added dcc.Link on html.button. Plesae check below code and suggest me what i am doing wrong.

import dash_core_components as dcc
2 import dash_html_components as html
3 from dash.dependencies import Input, Output, State, Event
4 from app import app
5 import figures
6 app.config.suppress_callback_exceptions = True
7
8 app.layout = html.Div([
9 dcc.Location(id=‘url’, refresh=False),
10 html.Div(id=‘page-content’)
11 ])
12
13 index_layout = html.Div(children=[
14 # dcc.Location(id=‘url’, refresh=False),
15 # html.Div(id=‘page-content’),
16
17 html.H4(“Please add Access Token”, hidden=False, id=“page_header”),
18 # Access form
19 html.Div(children=[
20 html.P(children=["Access Token: ",
21 dcc.Input(type=‘text’, id=‘input-box’, placeholder=‘Access Token’)]),
22 dcc.Link(html.Button(‘Submit’, id=‘submit’, type=‘submit’), href=’/dash-1’)
23 ], style={‘width’ : ‘30%’, ‘margin’ : ‘0 auto’, ‘align’ : ‘center’},

24 id=“login_form”, hidden=False)
25 ], style={‘display’ : ‘block’, ‘textAlign’ : ‘center’, ‘padding’ : 2,
26 ‘align’ : ‘center’, ‘marginBottom’: 50, ‘marginTop’: 25})
27 #html.Br(),
28 #html.Hr(style={‘width’ : ‘30%’}),
29 # footer
30 # html.Div(children=[
31 # ], style={‘padding’ : 7, ‘text-align’ : ‘center’})
32 #])
33
34 @app.callback(Output(‘page-content’, ‘children’),
35 [Input(‘url’, ‘pathname’)],
36 [State(‘input-box’, ‘value’)],
37 [Event(‘submit’, ‘click’)])
38 def display_page(pathname, value):
39 if pathname == ‘/dash-1’:
40 print(“Please wait… Dashboard is fetching data from gitlab”)
41 return figures.serve_layout(value)
42 else:
43 return None
44

Figures.py file have basic graph to show up
45 #app.scripts.config.serve_locally = True
46 external_css = [“https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css”, #pylint: disable=invalid-name
47 “https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css”, ]#pylint: disable=invalid-name
48
49 for css in external_css:
50 app.css.append_css({“external_url”: css})
51 if name == “main”:
52 app.run_server(debug=True)