[Zope3-Users] Buildout recipe for setting up a WSGI application for Zope 3 ?

Jim Fulton jim at zope.com
Sun Mar 2 18:57:54 EST 2008


On Feb 21, 2008, at 11:18 AM, Baiju M wrote:

> ----- "Jim Fulton" <jim at zope.com> wrote:
>> On Feb 21, 2008, at 7:28 AM, Baiju M wrote:
>>
>>> Hi,
>>> Is there any buildout recipe for setting up a WSGI application
>>> for Zope 3 ?  I know zopeproject is an option, but I am looking
>>> for a recipe which does something similar.
>>
>>
>> I'm working on one very slowly.  My recent efforts to clean up
>> zope.server are part of this effort. There's a good chance I'll have
>>
>> something by the end of the weekend.
>>
>> This will be a recipe, either similar to or an addition to
>> zc.zope3recipes that let's you define a past-deploy based application
>>
>> with a zope3 application.  My primary goal is to make it easy to
>> select a publication component.
>
> This is a great news.  I would love to see it in zc.zope3recipes  
> package itself,
> may be zc.zope3recipes:wsgiapp or something like that.


Here's an update.  The first step is to create sane PasteDeploy app  
factories. zope.paste tries very hard to fit in with the current  
byzantine system.  I appreciate the effort that went into this. :)

I decided to go back to basics, especially since my main goal is to  
make it easier for people to control the publication component used.   
I've created application factories for zope.publisher and  
zope.app.publisher.  I've released the zope.publisher version.  It is  
very bare-bones.  It is up to users to write a full publication object  
to go with it.

Here's a simple buildout that creates a paster script:

   [buildout]
   parts = paster

   [paster]
   recipe = zc.recipe.egg
   eggs = PasteScript
        zope.publisher
        zope.server
   interpreter = py

If you try this, you can create a very simple sample web server with  
the following config file;

   [app:main]
   use = egg:zope.publisher
   publication = egg:zope.publisher#sample

   [server:main]
   use = egg:zope.server
   host = 127.0.0.1
   port = 8080

Which you can run with:

   bin/paster serve --daemon config-file start

I'm working on an application factory for zope.app.publisher.  This  
will:

- Support the request-type selection framework in zope.app.publication.

- Provide a derivative of zope.publication.browser.BrowserPublication  
that provides a hook for specifying an application root,
   other than using ZODB.

- Provides optional support for loading ZCML before calling the  
publication factory.

I've got a few details to work out and I need to write some tests.   
Maybe I'll release this next weekend, or the weekend after.

After this, I'll be ready to add recipes to support it.

Jim

--
Jim Fulton
Zope Corporation




More information about the Zope3-users mailing list