How to use Dash button to perform some cleaning function for the app and also enable reload for the app in the browser?

Need to have a callback function in Dash App for performing some action and then refreshing the page, only page reload could be achieved using HTML A tag.

html.A(html.Button('Refresh Data'),href='/')

Required:

app.layout = html.Div([html.Button(id="refresh")])

@app.callback(Output('???', '???'),
          [Input('refresh', 'n_clicks')])
def refresh(n):
## Perform some action ##
## call python function API ##
## Finally Refresh the Page ##
 ?
return ?
1 Like

Hi @rohan_sharma could you find a solution?