On Sat, 2006-09-16 at 13:16 +0100, Tom Smith wrote:
> I would really like to be able in my views.py file to do a...
> 
> def do_something(request, x):
>       #do something that changes some session vars here...
>       #now go back to where you were
>       return HttpResponseRedirect(request.META['HTTP_REFERER'] )
> 
> .. but I always get...
> 
> ValueError
> Exception Value:      The view bah.xxx.views.do_something didn't return  
> an HttpResponse object.

Looks like it should work, since that's how HttpResponseRedirect is
used, but a couple of things to check:

Are you sure it's really getting to that last line and not returning
somewhere earlier?

Does request.META['HTTP_REFERER'] contain something sensible? This won't
be the cause of the problem, but it's worth checking.

If you trim it down to just returning the redirect instance and/or
hard-code in the string to redirect to, does the error go away?

Something in the bits you have waved your hands over is causing the
problem here, by the looks of it. So start weeding out as much as you
can until it starts working and then it you might get a few more clues
as to what is going on.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to