def app(**options):
    """Simple click example for overwrite dynaconf settings"""

    # change the environment to update proper settings
    settings.setenv(options["env"])

    # update the dynaconfig settings
    settings.update(options)

    assert options["host"] == settings.HOST
    assert options["port"] == settings.PORT
    assert options["env"] == settings.current_env

    # ensure that other env didn't change
    with settings.using_env("staging"):
        assert options["host"] != settings.HOST
        assert options["env"] != settings.current_env
Simple click example for overwrite dynaconf settings
tests_functional/legacy/click_override_generic/app.py