./s
On May 26, 6:57 pm, Rendy Anthony <rendy.anth...@gmail.com> wrote:
> You also need to return the result of bar() from foo. Example:
>
> def bar(request):
> print "In bar"
> return HttpResponseRedirect('"http://example.com")
>
> def foo(request):
> return bar()
>
> Regards,
> Rendy Anthonyhttp://solyaris.wordpress.com
>
>
>
> On Thu, May 27, 2010 at 9:50 AM, shacker <shac...@birdhouse.org> wrote:
> > I'm trying to figure out why HttpResponseRedirect doesn't work when
> > called from within another function. For example, this works, of
> > course:
>
> > def foo(request):
> > return HttpResponseRedirect('"http://example.com")
>
> > But this does not:
>
> > def bar(request):
> > print "In bar"
> > return HttpResponseRedirect('"http://example.com")
>
> > def foo(request):
> > bar()
>
> > In this second case, django will print "In bar" but the redirect does
> > not occur - it fails silently. Feel like I'm not understanding
> > something fundamental here.
>
> > Clues? Thanks.
>
> > --
> > 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+unsubscribe@googlegroups.com<django-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment