[google-appengine] Issues with redirects - getting 302 in browser

2011-08-01 Thread darrell
Hi,

I'm using Django nonrel with App Engine and having an issue with
redirects.

Very simple redirects in my view handlers:

@login_required
def dashboard(request):

   if check_if_user_needs_to_import(request.user):

   return redirect("user_welcome")

Are not redirecting properly in App Engine but rather returning this
message in the browser:

I've also tried not returning to a view, but to the url itself:
return redirect('/user/welcome/') and that does not work either.


Status: 302 FOUND Vary: Cookie Content-Type: text/html; charset=utf-8
Location: http://site.appspot.com/user/welcome/

If I enter the URL in again in the browser manually, it loads just
fine. This appears to only be an issue when using the redirect()
function, any view using render_to_response() works fine.

Any thoughts would be very much appreciated.

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



Re: [google-appengine] Issues with redirects - getting 302 in browser

2011-08-01 Thread Chris Copeland
Are you testing this from a regular browser?  What you're seeing are the
headers that the browser should be reading.

You could try using django.http.HttpResponseRedirect directly instead of the
shortcut and see if that helps.

-Chris

On Sun, Jul 31, 2011 at 9:04 AM, darrell  wrote:

> Hi,
>
> I'm using Django nonrel with App Engine and having an issue with
> redirects.
>
> Very simple redirects in my view handlers:
>
> @login_required
> def dashboard(request):
>
>   if check_if_user_needs_to_import(request.user):
>
>   return redirect("user_welcome")
>
> Are not redirecting properly in App Engine but rather returning this
> message in the browser:
>
> I've also tried not returning to a view, but to the url itself:
> return redirect('/user/welcome/') and that does not work either.
>
>
> Status: 302 FOUND Vary: Cookie Content-Type: text/html; charset=utf-8
> Location: http://site.appspot.com/user/welcome/
>
> If I enter the URL in again in the browser manually, it loads just
> fine. This appears to only be an issue when using the redirect()
> function, any view using render_to_response() works fine.
>
> Any thoughts would be very much appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

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