[Web-SIG] WSGI Utils & SCGI/Quixote.

Paul Boddie paul at boddie.org.uk
Wed Dec 1 00:20:42 CET 2004


On Tuesday 30 November 2004 20:01, Titus Brown wrote:
>
> My experience highlights an issue that needs to be dealt with by any
> WSGI server code.  Several app frameworks -- Quixote Webware, and Zope,
> for example -- expect to be handed control of an entire URL tree.

I handled this control issue using the following code:

# Magic dictionary for WSGIServer.

class MagicDict:
    def __init__(self, handler):
        self.handler = handler
    def has_key(self, name):
        return 1
    def __getitem__(self, name):
        return self.handler

When such an object is passed to WSGIServer, the specified handler always gets 
control, although it'd surely be preferable for so-called "WSGI middleware" 
to manage the URL space.

Paul


More information about the Web-SIG mailing list