On Jul 29, 8:19 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-07-27 at 05:11 +0000, SmileyChris wrote:
> > Sorry bout the unfinished second half of that last message, I was just
> > thinking through type and I meant to delete it before posting.
>
> > On Jul 27, 4:16 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
> > > The other problem is that although with the better WSGI adapters
> > > SCRIPT_NAME is provided correctly set for you automatically, in
> > > mod_python one cannot actually deduce SCRIPT_NAME automatically with
> > > the way the adapter works and so you push onto the user the need to
> > > define the mount point manually a second time.
>
> > I get that mod_python is a bit dumb, but my change isn't changing
> > anything for mod_python users. It only changes the behaviour of the
> > wsgi request handler.
>
> > > What it comes down to is there are a few sides issues that really need
> > > to be looked at at the same time and the simplistic change may not be
> > > adequate to cover these or not result in the same behaviour on all
> > > hosting solutions.
>
> > Granted, the one thing I hadn't put too much consideration into is url
> > `reverse` method. At the moment, it is totally decoupled from request,
> > so it can't figure out SCRIPT_NAME. Perhaps request could get a
> > SCRIPT_NAME aware reverse method (which would still work without it)?
>
> > Are there any other issues I'm missing?
>
> Coming in a bit late to this thread because I'm catching up on a back
> log today. Reverse URL construction (especially w.r.t things like HTTP
> redirects) is the big missing part. I was talking about this with a
> couple of people at OSCON, including discussing with Jacob how we can
> incorporate this so that the necessary backwards incompatibility changes
> aren't too painful. I've got a similar patch in one of my branches
> locally that I'll compare with your patch Chris and grab any bits I've
> missed. It'll be a couple of days before I'm all set up to test this
> correctly, since I'm travelling and reinstalled my laptop shortly before
> leaving, so I need to configure Apache, etc, first.
>
> Haven't worked out exactly how to acommodate things like mod_python not
> giving the full SCRIPT_NAME yet, but it's a relatively minor issue since
> it's just a fact of life we need to work around. Something will present
> itself.
>
> We do need to fix this, so thanks for the patch so far. We might as well
> fix the whole thing at once so that it's easier to move an existing
> setup to a different URL root without having to edit all the code
> (letting Apache handle the SCRIPT_NAME portion). Initially there will be
> a settings variable that will preserve backwards-compat and we'll break
> it a bit before 1.0 after everybody's had time to adjust their code. So
> it will be relatively painless.

FWIW, I know I said that SCRIPT_NAME can't be calculated in
mod_python. Well, that isn't strictly true.

If you are using mod_python 3.3.1 and have used the Location directive
then it is probably possible by using req.hlist.location.

I didn't mention this before because the fact it doesn't work with
older versions of mod_python nor when Location is not being used sort
of limits its usefulness. Didn't seem to make sense to therefore
depend on it.

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to