L
L
ledovitiy2019-04-21 01:52:48
Django
ledovitiy, 2019-04-21 01:52:48

How does flash work in Flask and Django?

form = UpdateAccount()

if form.validate_on_submit():
    current_user.username = form.username.data
    current_user.email = form.email.data
    db.session.commit()

    flash('Успешно обновлено', 'success')
    return redirect(url_for('account'))

Can you please explain why a flash message appears when submitting if there is a redirect right after? The page is completely reloaded. flash('Успешно обновлено', 'success')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2019-04-21
@deliro

It is stored in cookies or session. Take it and go to the source .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question