Пример #1
0
def init(configuration=None):
    if not configuration:
        configuration = {
            "raise_view_exceptions": gae_util.is_development(),
            "template_root": "templates",
            "use_db": False,
        }
    original_init(configuration)

    """ extend template filter example code
Пример #2
0
def site_config(key):
    global _site_config
    if not _site_config:
        env = "production"
        if gae_util.is_development():
            env = "development"
        string = open("config.yaml").read().decode("utf8")
        _site_config = yaml.load(string)[env]
    if _site_config.has_key(key):
        return _site_config[key]
    else:
        return None