On Thu, Jul 16, 2009 at 11:18 AM, Jumpfroggy <[email protected]>wrote:
> > On Jul 16, 11:05 am, Javier Guerra <[email protected]> wrote: > > maybe urlencode()'ing the '/page#section1' parameter? > > The first problem is that the django server only receives the '/page' > part of the URL. The browser itself holds onto the '#hash' part and > doesn't transmit that to the django server at all, so the > login_required() decorator calls request.get_full_path() and gets '/ > page', so that's what it uses. It doesn't look like there's a simple > way to get the '#hash' from django. > > Once I get it, yes I can use urlencode(full_path_with_hash) and use > that instead. There is a better way to get around this, although not perfect. As long as the posts and gets have the hash (fragment identifier or named anchor), the browser will carry the information through the redirects. Where it is currently lost is with the post to login. So all you need to do is put the hash on the post url, then when the user is redirected it remains. You can do this with a pretty basic javascript on the form: form.action = form.action + location.hash // I think that works across all browsers, but I am being lazy and not looking Then when a user submits the post and the browser gets a redirect, the fragment identifier or named anchor stays with the browser. This information isn't transmitted to the server in anyway so short of what you described above, Django can't really solve your issue. I hope that helps, Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

