Skip to content

Add support for multiple servers in configΒ #59

@yanokwa

Description

@yanokwa

I work with lots of different servers and it's a pain to constantly edit .pyodk_config.toml. I'd love to be able to switch profiles on the fly.

Given this .pyodk_config.toml, I'd like to be able to call Client(profile="demo") to use the demo url/user/pass and Client(profile="test") to use the test profile.

[demo]
base_url = "https://demo.getodk.cloud"
username = "alice"
password = "bob"

[default]
base_url = "https://www.example.com"
username = "my_user"
password = "my_password"
default_project_id = 123

[test]
base_url = "https://test.getodk.cloud"
username = "foo"
password = "bar"

Note that I have [default] for the default profile. Our docs for the single server config currently uses [central], so maybe if there is only one profile, that is the default regardless of what the header is. If there are two or more, then the default needs to be called [default]. Then we can update the docs to use [default].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions