1๐
โ
I think its cleaner to redirect to the same page after the form is complete.
This way you use a fresh GET request without any problems when reloading the url.
if method.POST:
...
if form.is_valid():
...
return HttpResponseRedirect(request.path)
๐คkanu
0๐
if request.method == "POST":
if form.is_valid():
...
...
form = ABCForm()
return render_to_response(request, context={'form':form}, RequestContext)
Here ABCForm
is your django form name which you are passing in context for displaying in django template
๐คNilesh
- [Answer]-How can I call all items in a list item?
- [Answer]-Construct form from queryset
- [Answer]-How to change the name of the document=True field of Haystack in Django?
- [Answer]-Django redirect still allows post on reload only on mobile Chrome
- [Answer]-Django 1.8 issue with user authentication
Source:stackexchange.com