//python
flash('some message for index page')
return redirect(url_for('index'))
//js
fetch('url',{
method:'POST'
})
.then((response)=>{
if(response.redirected){
window.location.href = response.url;
}
})
.catch(function(e){
})