[Grok-dev] does product-config work with paster?

Jan-Wijbrand Kolman janwijbrand at gmail.com
Fri Jan 29 05:15:08 EST 2010

Jan-Wijbrand Kolman <janwijbrand at gmail.com> wrote:
> Martijn Faassen <faassen at startifact.com> wrote:
>> I'm throwing this question into the group as I thought last week at the 
>> sprint we discussed this functionality briefly, and I got no indication 
>> it was broken in combination with paster setup. But now we got a report 
>> (see zc.z3monitor thread) that it is.
>> But perhaps Jan-Wijbrand who I think talked about it is not using paster 
>> yet in combination with product-config? Or perhaps I recall something 
>> else entirely. :)
> It depends on the version of zope.app.wsgi that is used. From 3.4.2 on product 
> config __should__ be supported. See:
>   http://pypi.python.org/pypi/zope.app.wsgi/
> Now, grok-1.0 uses that exact version, and the 1.1 alphas use an even newer 
> version.
> Not sure what is going on here... I'll have a look too, as this is something 
> apps really need.

For me, product config seems to work:

Tested with grok-1.0, with paster, mu zope_conf part in buildout.cfg looks like 

  recipe = collective.recipe.template
  input = etc/zope.conf.in
  output = ${buildout:parts-directory}/etc/zope.conf
  filestorage = ${buildout:directory}/var/filestorage
  blobstorage = ${buildout:directory}/var/blobstorage
  logfiles = ${buildout:directory}/var/log
  extra =
    <product-config configurare>
      test 1 2 3

And the app.py looks like this::

  import grok

  class Configurare(grok.Application, grok.Container):

  class Index(grok.View):

    def update(self):
        from zope.app.appsetup.product import getProductConfiguration
        print 'CCC', getProductConfiguration('configurare')

When I open this view, I indeed get this printed on the console::

  CCC {'test': '1 2 3'}

I'm now about to test with the latest grok alpha...

regards, jw

More information about the Grok-dev mailing list