bench set-config

Usage

bench set-config [OPTIONS] KEY VALUE

Description

Bench provides a wrapper command to insert or update values in the site config files. You can update values in your site's site\_config.json, along with the bench directory's common\_site\_config.json through the same command.

To read more about site configuration and understanding key precedence, refer to the docs here.

Flags

  • -g, --global Set value in the Bench's Common Site Config
  • -p, --parse Parse given value instead of string. You can use this to set dict and list values. This was --as-dict in earlier versions.

Examples

  1. Enable tests for given site.

    bench --site {site} set-config allow\_tests true
    
  2. Enable tests for all sites.

    bench --site all set-config allow\_tests true
    

    Using the above command, each site's site\_config.json will have the key-value "allow\_tests": true. This allows running tests on all of the sites.

    bench set-config -g allow\_tests true
    

    Using the above command, the bench's common\_site\_config.json will have the key-value "allow\_tests": true. This will allow each site on the bench to have tests run unless they have a value defined for the sma in their site\_config.json.

  3. Set a dict value in your site's frappe.conf

    bench --site {site} set-config backup '{"includes": ["Not", "ToDo"]}' --parse
    

    You can now access the list in code as frappe.conf.backup.get("includes").

Discard
Save

On this page