def configure_app()

in gstack/__init__.py [0:0]


def configure_app(settings=None):
    app.config['DATA'] = os.path.abspath(os.path.dirname(__file__)) + '/data'
    app.config['PATH'] = 'compute/v1/projects/'

    db.init_app(app)

    if settings:
        app.config.from_object(settings)
    else:
        args = _generate_args()
        profile = args.pop('profile')
        app.config['DEBUG'] = args.pop('debug')
        config_file = _load_config_file()
        database_uri = _load_database()
        _config_from_config_profile(config_file, profile)
        app.config['SQLALCHEMY_DATABASE_URI'] = database_uri