I have a python module, where i store my settings settings.py. This files contains lines like
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_URL = 'https://my-base-url.com/test'
...
SCORM_TEST_URL = BASE_URL + '/scorm2004testwrap.htm'
I want to allow users to override these settings e.g. by using command line options or environment variables. It works well for direct variable assignments when I do
import settings
settings.BASE_URL = 'test'
However
settings.SCORM_TEST_URL
#will print https://my-base-url.com/test/scorm2004testwrap.htm
Is there a way to tell python to update these dependant variables with the overridden values? Or how can I design my program, that it allows overriding of settings and as well setting variables in files that are python modules, because as you see it might need other python modules imports like os in the above example?