This is what SCGI reports ( apache 2.2.4, mod_scgi 1.12, with the
default main() invocation of scgi/scgi_server.py  ).

In this implementation at least, REQUEST_URI does not include the
proctal or hostname.
Essentially:

REQUEST_URI == SCRIPT_NAME + PATH_INFO + QUERY_STRING

HTTP_REFERER: 'http://www.example.com/SCGI/admin/auth/user/?
is_staff__exact=0&is_superuser__exact=1'
SERVER_SOFTWARE: 'Apache'
SCRIPT_NAME: '/SCGI'
HTTP_IF_MODIFIED_SINCE: 'Tue, 13 Feb 2007 21:09:34 GMT'
REQUEST_METHOD: 'GET'
PATH_INFO: '/admin/auth/user/'
SERVER_PROTOCOL: 'HTTP/1.1'
QUERY_STRING: 'is_staff__exact=0&is_superuser__exact=0'
CONTENT_LENGTH: '0'
HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_USER_AGENT: 'Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:
1.8.0.8) Gecko/20061110 Firefox/1.5.0.8'
HTTP_CONNECTION: 'keep-alive'
HTTP_COOKIE: 'sessionid=1716ddd961911ebc116289e96ee5154c'
SERVER_NAME: 'www.example.com'
REMOTE_ADDR: '24.91.6.59'
HTTP_IF_NONE_MATCH: '3a3005e07c1e77d8a32e489df7fb5b71'
SERVER_PORT: '80'
SERVER_ADDR: '63.67.205.253'
DOCUMENT_ROOT: '/web/root'
SERVER_ADMIN: 'admin.example.com'
HTTP_HOST: 'www.example.com'
HTTP_CACHE_CONTROL: 'max-age=0'
REQUEST_URI: '/SCGI/admin/auth/user/?
is_staff__exact=0&is_superuser__exact=0'
HTTP_ACCEPT: 'text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
REMOTE_PORT: '54317'
HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5'
SCGI: '1'
HTTP_ACCEPT_ENCODING: 'gzip,deflate'
UNIQUE_ID: 'HB8AWz9Dzf0AABBGAX0AAAAD'
HTTP_KEEP_ALIVE: '300'


On Feb 13, 7:24 pm, "Waylan Limberg" <[EMAIL PROTECTED]> wrote:
> On Tue, 13 Feb 2007 17:41:16 -0500, mulc <[EMAIL PROTECTED]> wrote:
>
> > OK.
>
> > I hacked django/core/handlers/wsgi.py. ( line #56 )
>
> > In the __init__ function of  WSGIRequest I changed:
>
> >   self.path = environ['PATH_INFO']
>
> >   to
>
> >   self.path = environ['REQUEST_URI']
>
> >   I then changed up my urls.py
>
> >      (r'^admin/', include('django.contrib.admin.urls')),
>
> >     becomes
>
> >      (r'/admin/?', include('django.contrib.admin.urls')),
>
> > This appears to do what I want.
>
> > No obvious breakage yet, but I haven't really done anything other than
> > tool through the admin interface at /SCGI/admin
>
> Well, that would also match the following urls (which you wouldn't want):
>
> /foo/admin/
> /foo/bar/admin/
> /foo/admin/bar/
>
> Sure, it's not likely that you'll have 'admin' in a lot of urls, but I
> think that illustrates the problem. You need to be able to match from the
> front of the url. If I recall correctly, 'REQUEST_URI' includes the
> proctal and domain and I wouldn't want to include that in every regex
> expression.
>
> --
> Waylan Limberg
> [EMAIL PROTECTED]


You are right.  The regex I posted is, overly broad, but that is not a
show-stopper I do not think.

My goal is not to have to modify any part of django, other than the
WSGI handler.   My concern is that modifying the path attribute of the
WSGIRequest object ( so as  to facilitate classic quixote-style scgi
usage:  setting path = SCRIPT_NAME+PATH_INFO, instead of PATH_INFO  )
that I am borking something in the WSGI domain that will break the
nesting of WSGI Apps.

I will need to get all of WSGI into my head before I am sure I am not
screwing something up.   I very much want to be able to mount multiple
WSGI apps under various points of an existing "filesystem."


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

Reply via email to