0Pricing
Flask Academy · Lesson

Redirect After Post (PRG Pattern)

Avoid duplicate submissions with a redirect.

The Double Submit Problem

After a form post, hitting refresh resends the same data. That can create duplicate orders, comments, or signups. 😬

Why Refresh Repeats

The browser remembers the last request. Reloading a page that was the result of a POST simply fires that POST again.

All lessons in this course

  1. Build an HTML Form That Posts
  2. Read and Default Query Parameters
  3. Validate Required Fields by Hand
  4. Redirect After Post (PRG Pattern)
← Back to Flask Academy