有什么方法可以在塔中组合配置/.ini 文件吗?

发布于 2024-12-01 17:28:09 字数 193 浏览 2 评论 0原文

我们正在运行一个带有多个 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久而酒知 2024-12-08 17:28:09

您可以使用 ConfigParser 模块。

You can use the ConfigParser module.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文