[Zope3-dev] zope.app.wsgi + zope.app.server.main

Jim Fulton jim at zope.com
Sun Nov 14 14:54:09 EST 2004


Phillip J. Eby wrote:
> Just a question here...  it seems to me that the approach recommended in 
> the zope.app.wsgi README for starting a server may be incorrect.  It 
> recommends using zope.app.server.main.setup(),

Eek. zope.app.wsgi *should not* use or depend on zope.app.server.

zope.app.server is specific to the Zope asyncore-based (medusa-like)
server framework.

Either more thinking is necessary or something needs to be factored out of
zope.app.server.



> but this creates a 
> ThreadedTaskDispatcher,  as well as possibly creating servers.
> 
> This seems wrong for a WSGI application, which is not a web server.  

Yup

> Indeed, looking some more at zope.app.server.main, it seems that the 
> 'debug()' function is actually what's needed.  IOW, it seems that 
> instead of:
> 
>     db = setup(load_options(args))
> 
> the correct thing to do would be:
> 
>     db = debug(args)
> 
> If I may suggest a change, perhaps the 'debug' function might be renamed 
> (or aliased) as 'serverless_startup' or something similar, since telling 
> people to use 'debug' might be a bit weird.

That is weird.  This looks like some kind of decoy.  It's not
used AFAICT.  I'd like to ask Fred is he knows what this is about.

Whatever, something like this should probably be available in appsetup.

> By the way, there is currently an active discussion on the Web-SIG 
> regarding deployment configuration for WSGI applications; I hope that we 
> will soon have a concrete recommendation for how to have a server tell a 
> WSGI application where to get its configuration file(s) from.  This 
> would allow us to add a bit more code to zope.app.wsgi, and then be able 
> to deploy Zope applications in deployment-ready WSGI servers without 
> requiring the user to write a startup script at all.

Cool.

Jim


More information about the Zope3-dev mailing list