Redirect to back to referrer page
<p>I am building an account settings page. I was thinking of having a few routes that only accept post request then edit the records and then go back the account settings page.</p>

<p>The problem is that there is two account settings pages. One for users and one for an  admin account.</p>

<p>The admin account_settings can use the same logic form the user account settings routes but If i use and post to use the user/account-settings route it returns back the user/account-settings route insted of the admin/user-account settings. </p>

<p>I was wondering how can flask returns back to the page it was on.</p>

<p>request.referrer will return back to the previous page. <a href="http://flask.pocoo.org/docs/0.11/reqcontext/" rel="nofollow">http://flask.pocoo.org/docs/0.11/reqcontext/</a></p>

python flask