2

We're running a pylons app with multiple ini files (production, staging, development, etc). When a new setting is added that can be the same in all environments, it would be great to be able to set it once in some sort of master configuration that gets included with all .ini files. Or included via some other way to load centralized config as well as deploy-specific config.

It doesn't look like there's an "import" syntax for pylons ini files. What's the best way to achieve this type of config compositing for pylons, if any?

dkuebric
  • 415
  • 1
  • 3
  • 6

1 Answers1

0

You can use the ConfigParser module.

eph
  • 1,988
  • 12
  • 25
  • Found good documentation on it (http://www.doughellmann.com/PyMOTW/ConfigParser/), but the actual config loading happens in the paster module afaik, so I'd probably do this somewhere in the pylons app and then merge the configs. Will look into, but not as free as I thought it might be. – dkuebric Aug 29 '11 at 18:07
  • For the record: another pylons-specific option is to manually add them to your config/environment in the app itself. – dkuebric Aug 30 '11 at 22:54