# Keep development and production settings distinct

Source: https://zotonic.com/docs/1481/keep-development-and-production-settings-distinct

URI: https://zotonic.com/id/1481

Language: en

Keep development and production settings distinct.

Set the site's environment intentionally and inspect the resolved value before relying on environment-specific tools. Development behavior can include trace controls, extra browser output, and asset settings that are unsuitable for normal visitor traffic.

Keep credentials outside shared documentation and committed examples. Give local installations their own database and hostname so an ordinary test cannot target the production site by accident.

Exercise the release configuration in an acceptance environment before deploying it. Compare the resolved settings, enabled modules, and storage paths when behavior differs between environments.

Find the configuration layer to change
--------------------------------------

Distinguish global Zotonic configuration, Erlang runtime configuration, site configuration files, and module settings stored for a site. Similar setting names can exist at different layers.

Use `bin/zotonic configfiles` and `bin/zotonic siteconfigfiles garden` to locate the files that the command resolves. Use the corresponding configuration display commands to inspect the values, taking care when sharing output that may include credentials.

Check the implementation of a setting to see when it is read. Some values are consulted on each request; others are used at process or site startup.

Inspect global and site configuration
-------------------------------------

Use the command suited to the question:

```sh
bin/zotonic configfiles
bin/zotonic configtest
bin/zotonic siteconfigfiles garden
bin/zotonic siteconfig garden
```

`configfiles` and `siteconfigfiles` locate configuration sources. `configtest` checks global configuration loading. `siteconfig` prints the site's file-based configuration; it is not a complete dump of every database-backed module setting.

For runtime values, use the relevant model or configuration API in the running context. `setconfig` changes global runtime Zotonic settings without writing configuration files.

Do not share unredacted configuration output: database passwords and other secrets may be present. See [Find the configuration layer to change](/id/2990) and [Change a runtime setting deliberately](/id/2991).

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1481?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1481?language=en>)
