[Grok-dev] how to read config from zope.conf
cklinger at novareto.de
Wed Nov 10 04:24:43 EST 2010
Am 09.11.10 23:14, schrieb Martijn Faassen:
> 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
> documentation. :)
More information about the Grok-dev