【问题标题】:What is the best way to store config settings in Google App Engine? [closed]在 Google App Engine 中存储配置设置的最佳方式是什么? [关闭]
【发布时间】:2016-05-10 02:29:41
【问题描述】:

我有一个基于 python 的谷歌应用引擎网络服务器。我想保存某些配置,这样配置更改不应该保证服务器重启。例如,我的网络服务器向另一台服务器发出 http 请求,我想将辅助服务器的主机:端口存储为配置设置。

我正在考虑为此使用数据库表。是否有其他替代方案,例如环境变量等?

【问题讨论】:

标签: python google-app-engine application-settings


【解决方案1】:

我最终按照Python and YAML- GAE app settings file 中的建议创建了一个数据库表来存储配置

class Config(db.Model):
    """
    Application Config
    """   

    name  = db.StringProperty(required=True)
    value = db.StringProperty(required=True)

    @staticmethod
    def create_config(name,
                      value):
        pass

【讨论】:

    猜你喜欢
    • 2021-09-01
    • 2012-04-06
    • 2011-11-26
    • 1970-01-01
    • 2019-06-26
    • 1970-01-01
    • 1970-01-01
    • 2012-10-03
    • 2016-11-23
    相关资源
    最近更新 更多