Exemplo n.º 1
0
def update_env():
    'Save any environment variables as JSON'

    env_vars_string = config('environment_variables')

    if env_vars_string:
        env_vars = parse_json_file(env_file_path)

        for env_var_string in env_vars_string.split(' '):
            key, value = env_var_string.split('=')
            value = dequote(value)
            env_vars[key] = value

        save_to_json_file(env_file_path, env_vars)
Exemplo n.º 2
0
def unlink_webservice():
    """
    Remove "WEBSERVICE_URL" environment variable
    """

    log('Function: unlink_database')

    env_vars = parse_json_file(env_file_path)

    if 'WEBSERVICE_URL' in env_vars:
        del env_vars['WEBSERVICE_URL']

        save_to_json_file(env_file_path, env_vars)

        # Reset wsgi relation settings
        wsgi_relation()
Exemplo n.º 3
0
def unlink_database(variable_name):
    """
    Remove "DATABASE_URL" environment variable
    """

    log('Function: unlink_database')

    env_vars = parse_json_file(env_file_path)

    if 'DATABASE_URL' in env_vars:
        del env_vars['DATABASE_URL']

        save_to_json_file(env_file_path, env_vars)

        # Reset wsgi relation settings
        wsgi_relation()