在 Google App Engine 中存储配置设置的最佳方式是什么?
What is the best way to store config settings in Google App Engine?
我有一个基于 python 的 google 应用引擎网络服务器。我想保存某些配置,这样配置更改就不需要重新启动服务器了。例如,我的网络服务器向另一台服务器发出 http 请求,我想将辅助服务器的 host:port 存储为配置设置。
我正在考虑为此使用数据库 table。是否有其他替代方案,例如环境变量等?
我最终创建了一个数据库 table 来存储 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
我有一个基于 python 的 google 应用引擎网络服务器。我想保存某些配置,这样配置更改就不需要重新启动服务器了。例如,我的网络服务器向另一台服务器发出 http 请求,我想将辅助服务器的 host:port 存储为配置设置。
我正在考虑为此使用数据库 table。是否有其他替代方案,例如环境变量等?
我最终创建了一个数据库 table 来存储 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