fix: check CMS_CFG before STUDIO_CFG; prefer the latter

This commit is contained in:
Kyle McCormick
2021-12-08 10:51:11 -05:00
committed by Kyle McCormick
parent 51fccf06d1
commit 5e30c725a1

View File

@@ -10,6 +10,7 @@ This is the default template for our main set of AWS servers.
import codecs
import copy
import os
import warnings
import yaml
from corsheaders.defaults import default_headers as corsheaders_default_headers
@@ -52,7 +53,15 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
############### END ALWAYS THE SAME ################################
# 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')
try:
CONFIG_FILE = get_env_setting('CMS_CFG')
except ImproperlyConfigured:
CONFIG_FILE = get_env_setting('STUDIO_CFG')
warnings.warn(
"STUDIO_CFG environment variable is deprecated. Use CMS_CFG instead.",
DeprecationWarning,
stacklevel=2,
)
with codecs.open(CONFIG_FILE, encoding='utf-8') as f:
__config__ = yaml.safe_load(f)