0
I’m trying to deploy a Dash app with Render, and keep getting this error:
objgunicorn.errors.AppImportError: Failed to parse 'app.server' as an attribute name or function call.
Below is the relevant code:
app = Dash(__name__)
server=app.server
app.layout = html.Div(
[
html.Div(
className= 'title',
children= 'The Show - Season Stats'
),
html.Div(
dash_table.DataTable(
statsdf.to_dict('records'),
id = 'table',
columns=[{'id': c, 'name': c, 'type': 'text'} for c in statsdf.columns],
sort_action='native',
style_data_conditional= [
{
'if': {
'column_id': 'Team'
},
'textAlign': 'left',
'width': '10%',
'paddingLeft': '1%'
}
],
style_data= {'fontFamily': 'Nunito Sans',
'width': '5%',
'textAlign': 'center',
'height': '40px'},
style_header_conditional= [
{
'if': {
'column_id': 'Team'
},
'textAlign': 'left',
'paddingLeft': '1%'
}
],
style_header= {'fontFamily': 'Nunito Sans',
'fontWeight': 'bold',
'textAlign': 'center',
'height': '10%'}
)
)
]
)
if __name__ == '__main__':
app.run_server(debug=True)
And here is the content of my Procfile. I think there may be an issue the way that this is being read during deployment, but I’m not certain.
web: gunicorn Fantasy_Stats_Tracking:server
Any help would be great, thanks in advance!