有什么方法可以在塔中组合配置/.ini 文件吗?
我们正在运行一个带有多个 ini 文件(生产、暂存、开发等)的 pylons 应用程序。当添加在所有环境中都相同的新设置时,如果能够在所有 .ini 文件中包含的某种主配置中设置一次,那就太好了。或者通过其他方式加载集中式配置以及特定于部署的配置。
pylons ini 文件似乎没有“导入”语法。如果有的话,实现这种类型的塔架配置合成的最佳方法是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ConfigParser 模块。
You can use the ConfigParser module.