Yes, don't load the page via POST.
POST requests are meant to be used for data modifying requests, which
is why all user agents prompt you whether you really want to resubmit
the request. GET requests are not meant to be used for data modifying
requests, which is why they don't prompt you.
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No, you can't prevent a web browser from re-POSTing forms.
What you can do is prevent the browser from ever staying on a
POST-generated page: the standard best practice is a technique called
"Post/Redirect/Get": see
http://en.wikipedia.org/wiki/Post/Redirect/Get for a high-level
description.
In Django, this translates to view functions that look like::
from django.shortcuts import redirect, render
def my_post_view(request):
if request.method == 'POST'
# do something here...
return redirect('some_other_view')
else:
# the request was a GET, so render a template:
return render(request, 'some/template.html')
The key part here to get is that you should always issue a redirect
after a successful POST request.
Jacob