redirect a post request django

Solutions on MaxInterview for redirect a post request django by the best coders in the world

showing results for - "redirect a post request django"
Alyson
02 May 2018
1def redirected_view(request):
2    # Some processing if needed
3    ...
4    # save post data to session & redirect
5    request.session['_post_data'] = request.POST
6    return HttpResponseRedirect('redirect_to_view')
7
8def redirect_to_view(request):
9    old_post = request.session.get('_post_data')
10    # Use saved _post_data & delete it