I'd like an equivalent of the Django One True Way settings layout: a shared base file, and then a production file and a development file, each of which import the shared base.
Is this possible with Pyramid's config?
I'd like an equivalent of the Django One True Way settings layout: a shared base file, and then a production file and a development file, each of which import the shared base.
Is this possible with Pyramid's config?
Yes that's possible. In one of my projects I have a production_base.ini
file and all other production inis 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 paste docs for more examples.
Side note - you can't inherit logging section though.
config
? –
Pericycle config.registry.settings['somevar']
. You can see more here. Or did you mean using config
within a .ini file? –
Denticulation use =
will not work in the sections related to logging. The configparser module will raise a KeyError
for keys you'd expect to be imported (e.g. keys
, class
). Looks like the inheritance is a PasteDeploy feature, and not generally supported in .ini
files. –
Defense © 2022 - 2024 — McMap. All rights reserved.