Skip to main content
Version: 0.11


After office politics, you decide that you want to use MySQL by default. You no longer want to type db=mysql every time you run your application.

You can add a defaults list into your config file.

Config group defaults#

Configuration file: config.yaml

- db: mysql

Remember to specify config.yaml as the config_path.

def my_app(cfg):

When you run the updated application, MySQL is loaded by default.

$ python
driver: mysql
pass: secret
user: omry

Overriding a config group default#

You can still load PostgreSQL, and override individual values.

$ python db=postgresql db.timeout=20
driver: postgresql
pass: drowssap
timeout: 20
user: postgres_user

You can prevent a default from being loaded by assigning null to it in the command line:

$ python db=null

Non-config group defaults#

Sometimes a config file you want to merge does not belong in any config group. The following will load some_file.yaml from your config directory:

- some_file

Config files that not a part of a config group like db cannot be overridden.

Last updated on by Jasha10