500 Internal Server Error - Jupyter Notebook

Help me please. My code is returning 500 Internal Server Error when I enter the dash link

Code:

app = dash.Dash()

Definimos a função que irá determinar os componentes de layout HTML das tabelas:

def gera_tabela(dataframe, max_rows=10):
return html.Table([
html.Thead(
html.Tr([html.Th(col) for col in dataframe.columns])
),
html.Tbody([
html.Tr([
html.Td(dataframe.iloc[i][col]) for col in dataframe.columns
]) for i in range(min(len(dataframe), max_rows))
])
])

colors = {
‘background’: ‘#D9DBDB’,
‘text’: ‘#7FDBFF
}

Construção das tabelas via parâmetros HTML:

dash_table0 = dash_table.DataTable(
id=‘dashtable0’,
editable=False,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in validation_view.columns],
data=validation_view.to_dict(‘records’),
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘auto’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘auto’,
‘margin-left’: ‘auto’,
‘width’: ‘auto’
},
style_cell={
‘whiteSpace’: ‘auto’,
‘maxHeight’: ‘90vh’,
‘textAlign’: ‘left’,
‘width’: ‘auto’,
})

dash_table6 = dash_table.DataTable(
id=‘dashtable6’,
editable=False,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in asked_conditions.columns],
data=asked_conditions.to_dict(‘records’),
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘80%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘maxHeight’: ‘70vh’,
‘textAlign’: ‘left’,
‘width’: ‘80%’,
})

dash_table7 = dash_table.DataTable(
id=‘dashtable7’,
editable=False,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in perform_conditions.columns],
data=perform_conditions.to_dict(‘records’),
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘auto’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘80%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘maxHeight’: ‘70vh’,
‘textAlign’: ‘left’,
‘width’: ‘80%’,
})

dash_table9 = dash_table.DataTable(
id=‘dashtable1’,
editable=False,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in sinistralidade_0920.columns],
data=sinistralidade_0920.to_dict(‘records’),
style_as_list_view=True,
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘auto’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘70%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: ‘55%’,
})

dash_table1 = dash_table.DataTable(
id=‘dashtable1’,
editable=False,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in shpt_analysis.columns],
data=shpt_analysis.to_dict(‘records’),
style_as_list_view=True,
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘auto’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘70%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: ‘55%’,
})

dash_table2 = dash_table.DataTable(
id=‘dashtable2’,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in visual_terms.columns],
data=visual_terms.to_dict(‘records’),
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘100%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: ‘55%’,
})

dash_table3 = dash_table.DataTable(
id=‘dashtable3’,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in shtable_frame.columns],
data=shtable_frame.to_dict(‘records’),
fixed_rows={‘headers’: False},
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
tooltip_conditional=[
{
‘if’: {
‘filter_query’: ‘{Aptidão do Item} contains “Recusar Item”’
},
‘type’: ‘markdown’,
‘value’: ‘Sugestão: Recusar Item.’
}
],
style_data_conditional=[
{
‘if’: {
‘filter_query’: ‘{Aptidão do Item} contains “Recusar Item”’
},
‘backgroundColor’: ‘#054F82’,
‘color’: ‘white’,
‘textDecoration’: ‘underline’,
‘textDecorationStyle’: ‘dotted’,
}
],
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘80%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: 88,
‘minWidth’: 88,
‘maxWidth’: 88
})

dash_table4 = dash_table.DataTable(
id=‘dashtable4’,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in campaign_analysis.columns],
data=campaign_analysis.to_dict(‘records’),
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘100%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: ‘55%’,
})

dash_table5 = dash_table.DataTable(
id=‘dashtable5’,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in index.columns],
data=index.to_dict(‘records’),
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘100%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: ‘55%’,
})

dash_table8 = dash_table.DataTable(
id=‘dashtable8’,
sort_action=“native”,
columns=[{“name”: i, “id”: i} for i in atention_city.columns],
data=atention_city.to_dict(‘records’),
column_selectable=“single”,
row_selectable=“multi”,
style_header={
‘backgroundColor’: ‘#be2037’,
‘fontWeight’: ‘bold’,
‘color’: ‘#FFFFFF
},
style_table={
‘maxHeight’: ‘70vh’,
‘overflowY’: ‘scroll’,
‘margin-top’: ‘5vh’,
‘margin-left’: ‘3vh’,
‘width’: ‘100%’
},
style_cell={
‘whiteSpace’: ‘normal’,
‘textAlign’: ‘left’,
‘width’: ‘55%’,
})

Construção do layout da página e display das tabelas:

app.layout = html.Div([html.H1(children=‘Resumo’),
html.Div([dash_table0],style={‘display’: ‘inline-block’}),
html.Div([dash_table6], style = {‘display’: ‘inline-block’}),
html.Div([dash_table7], style = {‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘Sharepoint Table’),
html.Div([dash_table1], style={‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘PSR - Resumo’),
html.Div([dash_table2], style={‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘Sherlock Table’),
html.Div([html.Div([dash_table3], style={‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘Campanha - Resumo’),
html.Div([html.Div([dash_table4], style={‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘Validação de Incongruência’),
html.Div([html.Div([dash_table5], style={‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘Municípios de Atenção’),
html.Div([html.Div([dash_table8], style={‘display’: ‘inline-block’}),
html.Div([html.H1(children=‘Sinistralidade’),
html.Div([html.Div([dash_table9], style={‘display’: ‘inline-block’}),
])])])])])])])])])])])])], style={‘backgroundColor’: colors[‘background’]})

Rodar a aplicação

if name ==‘main’:
app.run_server(debug = True)