Avoid Resubmitted Form Upon Refresh Django.How

Author avatar wrote on 06/06/2022

After successful submission and processing of a web form, you need to use a return HttpResponseRedirect

def some_view(request):
  if request.method == "POST":
    form = some_form(request.POST)
    if form.is_valid():

Do processing
Save model, etc.

      return HttpResponseRedirect("/some/url/")
  return render_to_response("normal/template.html", {"form":form}, context_instance=RequestContext(request))

JS Way

We stand with Ukraine