Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
Hiroshi Ichikawa edited this page Jul 11, 2018 · 4 revisions

Person Finder has a concept of config which is key-value store to configure the app and repositories.

There are two types of config; global (repository independent) config and per-repository config.

A key must be a string. A value can be in any types supported by JSON.

Read/write configs in the admin page

Most of the configs are editable as "Global settings" and "Repository settings" in the admin page (/global/admin). But some configs are only configurable via command line (see below), or only updated programatically in the code (see below).

Read/write configs in command line

For Person Finder running locally:

$ ./tools/console localhost:8000
config.get("global_conf_name")
config.set(global_conf_name="conf_value")
config.get_for_repo("japan", "per_repo_conf_name")
config.set_for_repo("japan", per_repo_conf_name="conf_value")

For Person Finder running on AppEngine:

$ ./tools/console my-app-id.appspot.com
config.get("global_conf_name")
config.set(global_conf_name="conf_value")
config.get_for_repo("japan", "per_repo_conf_name")
config.set_for_repo("japan", per_repo_conf_name="conf_value")

Read/write configs programatically:

import config

config.get("global_conf_name")
config.set(global_conf_name="conf_value")
config.get_for_repo("japan", "per_repo_conf_name")
config.set_for_repo("japan", per_repo_conf_name="conf_value")

Implementation

app/config.py

Clone this wiki locally