On 03/15/2012 12:35 AM, Russell Keith-Magee wrote:
> 
> On 15/03/2012, at 5:32 AM, Gelonida N wrote:
> 
>> Hi,
>>
>> I'm having a django view, that works for GET and POST requests.
>>
>> Basically une can view some data with GET
>> and add / moify data with a tiny form and POST
>>
>> As the data can change I added a refresh button and this works fine.
>>
>> The problem is just, that some users don't use it but insist on using
>> the F5 (reload) key of their browser.
>>
>>
>> F5 works also well if the previous request was a GET request.
>>
>> However if the previous request was a POST request the browser rebosts
>> and fould thus add some data a second time.
>>
>>
>> Now my question:
>>
>> How to fix this best I have some (untested) ideas, but am not sure
>> what's best.
>>
>> 1.) redirect to same url after post.
> 
> Redirect after post is the right approach. So much so, that it is stated as 
> the right approach (and described as "just good Web development practice") in 
> Django's tutorial 4.
> 
> Yours,
> Russ Magee %-)
> 
Thanks a lot.

Probably I'll do this at least for a start.


I'd still bec curious though, whether there were other approaches
avoiding the redirect, as some of the users will connect over very slow
networks.

So there might be the small risk of a noticable increased latency.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to