2013/5/25 Amber Jain <i.amber.j...@gmail.com>

> Hello,
>
> I can't seem to access request.GET['next'] (from a URL with a query
> string). Here's what I'm doing:
> localhost:8000/dashboard/ points to dashboard() view but the dashboard()
> view uses @login_required decorator. And so, if the user isn't logged in,
> localhost:8000/dashboard/ redirects to localhost/login/?next=/dashboard/
> (but I can't access request.GET info after login).
>
> Here's my dashboard() view: http://dpaste.org/Z9dZX/ ... i.e. when
> dashboard view is loaded after successful login (from
> localhost/login/?next=/dashboard/), I see "You submitted an empty query
> string.", when in fact I expect to see the request.GET data from the URL
> query string.
>
> Can anyone point out the error(s) in my code? I can provide other parts of
> my code if you want.


I can't say exactly what you're doing *wrong*, because this is the behavior
I would expect. The ?next query parameter is used by the default login view
to tell Django where it should send the user after the user has been logged
in [1]. The ?next argument is dropped from the query string because it has
already fulfilled its purpose at that point, it wasn't an argument for your
dashboard view. Can you tell us what do you want to achieve with this?

[1]
https://github.com/django/django/blob/master/django/contrib/auth/views.py#L48

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


Reply via email to