fetch('url',{
method:'POST'
})
.then((response)=>{
if(response.redirected){
window.location.href = response.url;
}
})
.catch(function(e){
})
//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){
})