From 1a273f2e64a96007be8e50cf0aa3a31da25fe4e9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 18 Dec 2019 17:16:38 +0300 Subject: [PATCH] docs: Fix explanation of case sensitivity for `Settings` (#1110) * docs: Fix explanation of case sensitivity for `Settings` * Add changes * Update docs/usage/settings.md Co-Authored-By: Samuel Colvin * Update docs/usage/settings.md Co-Authored-By: Samuel Colvin * Update docs/usage/settings.md Co-Authored-By: Samuel Colvin --- changes/1105-tribals.md | 1 + docs/usage/settings.md | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changes/1105-tribals.md diff --git a/changes/1105-tribals.md b/changes/1105-tribals.md new file mode 100644 index 0000000..ee40cf3 --- /dev/null +++ b/changes/1105-tribals.md @@ -0,0 +1 @@ +docs: Fix explanation of case sensitive environment variable names when populating `BaseSettings` subclass attributes. diff --git a/docs/usage/settings.md b/docs/usage/settings.md index b23188f..77b79eb 100644 --- a/docs/usage/settings.md +++ b/docs/usage/settings.md @@ -50,8 +50,11 @@ Case-sensitivity can be turned on through the `Config`: {!.tmp_examples/settings_case_sensitive.py!} ``` -When `case_sensitive` is `True`, the environment variable must be in all-caps, -so in this example `redis_host` could only be modified via `export REDIS_HOST`. +When `case_sensitive` is `True`, the environment variable names must match field names (optionally with a prefix), +so in this example +`redis_host` could only be modified via `export redis_host`. If you want to name environment variables +all upper-case, you should name attribute all upper-case too. You can still name environment variables anything +you like through `Field(..., env=...)`. !!! note On Windows, python's `os` module always treats environment variables as case-insensitive, so the