> 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.

The only way I know around this involves leaning on JavaScript to 
get the URL, split off the #hash bit from it, and sneak it in as 
a hidden element on the login form.  It breaks for those of us 
that use the Firefox NoScript plugin or browse from a 
non-JS-enabled browser (such as Lynx or Dillo which I use 
regularly) but it merely provides a convenience the user is 
opting to forgo.

So if you execute something like

   function snag_loc() {
     var loc = window.location.href;
     var bits = loc.split('#');
     var fragment = "";
     if (bits.length > 1) {
       fragment = bits[1];
     }
     document.forms['myloginform'
       ].elements['hidden_fragment_input'
       ].value = fragment;
   }

on loading, it will set the value of your "hidden_fragment_input" 
field to the fragment it found in the URL, which will then make 
it available to the login POST.

-tim



--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to