Can I have multiple ini configuration files in Pyramid?

I would like to get the equivalent of the Django One True Way settings layout: a common base file, and then a production file and development file, each of which imports a common base.

Is this possible with Pyramid configuration?

+7
python pyramid ini paster python-paste
source share
1 answer

Yes it is possible. In one of my projects, I have a production_base.ini file, and all its other derivatives inherit from it:

production_base.ini

 [app:main] use = egg:xxx maintenance_mode = False 

production_www.ini

 [app:main] use = config:production_base.ini maintenance_mode = True # overwrites the value in the base ini 

You can also check to insert documents for more examples.

Side note - you cannot inherit the logging section.

+6
source share

All Articles