[Grok-dev] how to read config from zope.conf
faassen at startifact.com
Tue Nov 9 17:14:47 EST 2010
On 11/07/2010 11:32 AM, Christian Klinger wrote:
> i think the following steps are needed to read a custom configuration
> form zope.conf...
> 1) You have to create your config at the end of the etc/zope.conf.ini file:
> # Extra configuration lines can be added to zope_conf's extra option.
> Put for
> # instance productconf sections in here.
> <product-config database>
> dbname oracle
> 2) run bin/buildout
> 3) To access theses configuration in your python module you can do the
> from zope.app.appsetup.product import getProductConfiguration
> config = getProductConfiguration('database')
> dbname = config.get('dbname', 'default')
This would work well as a howto somewhere, perhaps in our new community
More information about the Grok-dev