Beispiel #1
0
def load_configs(configuration_files):
    v.automatic_env()
    v.set_env_key_replacer(".", "_")
    v.set_config_type("yaml")
    v.add_config_path("./resources/configurations")

    for configuration_file in configuration_files:
        v.set_config_name(configuration_file)
        v.merge_in_config()
Beispiel #2
0
def env_setup():
    v.set_env_prefix("li")
    v.automatic_env()

    if not v.is_set("api_key") or not v.is_set("api_host"):
        print("LI_API_KEY or LI_API_HOST environment variables not found.")
        sys.exit()

    if not v.get("api_host").endswith(API_VERSION_PATH):
        print("ERROR: LI_API_HOST environment variable must end with " + API_VERSION_PATH)
        print("LI_API_HOST current value: " + v.get("api_host"))
        sys.exit()

    layint_api.configuration.verify_ssl = v.get_bool("verify_ssl")
Beispiel #3
0
def setup_vyper(parser):
    env_name = os.getenv("APP_ENV_NAME", "LOCAL").lower()
    config_name = "config.{}".format(env_name)

    v.bind_args(parser)

    v.set_env_prefix(v.get("environment_variables_prefix"))
    v.set_env_key_replacer("-", "_")
    v.automatic_env()

    v.add_config_path("config")
    v.set_config_type("toml")
    v.set_config_name(config_name)
    v.read_in_config()
def setup_vyper(parser, overrides):
    defaults = _get_default_args(parser)

    actual_overrides = \
        {k: val for k, val in overrides.items() if defaults[k] != val}
    env_name = os.getenv("APP_ENV_NAME", "LOCAL").lower()
    config_name = "config.{}".format(env_name)

    _setup_args(parser)
    _setup_overrides(actual_overrides)

    v.set_env_prefix(v.get("env_vars_prefix"))
    v.automatic_env()

    v.add_config_path("config")
    v.set_config_type("toml")
    v.set_config_name(config_name)
    v.read_in_config()
Beispiel #5
0
def setup_vyper(parser: argparse.ArgumentParser,
                overrides: Dict[str, Any] = None):
    env_name = os.getenv("APP_ENV_NAME", "LOCAL").lower()
    config_name = "config.{}".format(env_name)

    v.bind_args(parser)

    if overrides:
        for k, val in overrides.items():
            v.set(k, val)

    v.set_env_prefix(v.get("environment_variables_prefix"))
    v.set_env_key_replacer("-", "_")
    v.automatic_env()

    v.add_config_path("config")
    v.set_config_type("toml")
    v.set_config_name(config_name)
    v.read_in_config()
Beispiel #6
0
INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'taggit',
    'account',
    'code_metadata',
    'dataset',
    'problem',
    'competition',
]

AUTH_USER_MODEL = 'account.User'

# Internationalization
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True

TAGGIT_CASE_INSENSITIVE = True

if 'CONFIG_DIR' in environ:
    v.add_config_path(environ['CONFIG_DIR'])
v.add_config_path('configs')
v.add_config_path('/configs')
v.watch_config()

v.automatic_env()
v.set_env_prefix('roboepics')
Beispiel #7
0
def set_environment_variables():
    v.set_env_prefix("botaclan")
    v.set_env_key_replacer(".", "_")
    v.automatic_env()