-
Notifications
You must be signed in to change notification settings - Fork 0
/
invenio.cfg
25 lines (20 loc) · 927 Bytes
/
invenio.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Handle loading config from project directories.
The import machinery implemented here allows configuration of the module to use for
settings via the environment variable INVENIO_SETTINGS_MODULE. This provides a flexible
scheme for configuring and overriding settings for different environments (e.g. dev
vs. production). Inspired by the Django approach to configuration.
The default configuration is providied by the ic_data_repo.config module and is
suitable for local deployment for development only.
"""
import os
from importlib import import_module
settings_module_path = os.getenv("INVENIO_SETTINGS_MODULE", "ic_data_repo.config")
settings_module = import_module(settings_module_path)
# inject objects from settings_module into this module
globals().update(
{
attr_name: getattr(settings_module, attr_name)
for attr_name in dir(settings_module)
if not attr_name.startswith("_")
}
)