But what I want to know is how edx-platform reads the *.env.json files end load the values in Django settings.
I was not able to find in edx-platform source a function that reads these files.
I don’t know exactly how they are converted in Tutor’s source code, but I am under the impression they end up in the production.py files under $TUTOR_ROOT/env/apps/openedx/settings/lms/production.py and $TUTOR_ROOT/env/apps/openedx/settings/cms/production.py
The cms/envs/tutor/production.py imports cms/envs/production.py who imports cms/envs/common.py.
In cms/envs/production.py we have this part of the code that reads the config env file:
# A file path to a YAML file from which to load all the configuration for the edx platform
CONFIG_FILE = get_env_setting('STUDIO_CFG')
with codecs.open(CONFIG_FILE, encoding='utf-8') as f:
__config__ = yaml.safe_load(f)
# ENV_TOKENS and AUTH_TOKENS are included for reverse compatability.
# Removing them may break plugins that rely on them.
ENV_TOKENS = __config__
AUTH_TOKENS = __config__