-
Notifications
You must be signed in to change notification settings - Fork 46
Config file
In order to avoid hard coding commonly used data, or data that may be a security risk (such as filepaths, instrument configurations, etc.), the jwql application employs a configuration file to store such information. The jwql code expects this config file to be named config.json, and to be placed within the main directory in individual clones of the jwql repository. This can be achieved by the following:
- If you have not yet done so, install the
jwqlpackage. See the installation instructions for further details. - Navigate to the
jwql/jwql/directory of where the package is installed. - Retrieve a copy of the config.json file from this innerspace page and save it in this directory.
Since some of these data contain sensitive information, we do not provide the actual values here. Please ask a JWQL team member or email jwql@stsci.edu if you need assistance.
These data can be accessed in a jwql script via the utils.py module, for example:
from jwql.utils.utils import get_config
settings = get_config()
connection_string = settings['connection_string']In this case, settings is a python dict containing the key/value pairs stored in the config.json file.