Can I have multiple ini config files in Pyramid?

社会主义新天地 提交于 2019-11-30 14:10:28

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/29258175/can-i-have-multiple-ini-config-files-in-pyramid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!