On Apr 26, 7:40 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Sun, Apr 26, 2009 at 7:39 PM, Chris <chriss...@gmail.com> wrote:
>
> > I've noticed a Redirect/Get is issued automatically after every Post
> > made. Is there any way to disable this feature? I can't find anything
> > in the docs about this.
>
> > Regards,
> > Chris
>
> Where are you talking about?  No where does django impose upon you a
> post-redirect-get pattern for your own views, it just happens to be the
> convention.

My view returns a normal HTML response by default, and a JSON response
for Ajax requests. So it looks like:

if request.is_ajax():
    return JSONResponse({'response_value': 123})
else:
    response = render_to_response('my_page.html',
                                  locals(),
                                  context_instance=RequestContext
(request),
                            )
    response.set_cookie('my_cookie', 123)
return response

And for either method, if it's a form post, I get a 302 redirect, and
I really have no idea why. It's driving me nuts.

Chris
--~--~---------~--~----~------------~-------~--~----~
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