diff --git a/README.md b/README.md index a548a947815d6e6f29801ca8b049dca1d00005d0..8cae3b99e4e03cbeb9198d8f2eee1d6e3b051617 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ example configuration parameters. These parameters should stored in a file formatted similarly to `config.json.example`, and the name of this file should be stored in the environment -variable `SETTINGS_FILENAME` when running the service. +variable `CONFIG_FILENAME` when running the service. ## Running this module @@ -33,7 +33,7 @@ For example, the application could be launched as follows: ```bash $ export FLASK_APP=app.py -$ export SETTINGS_FILENAME=config.json +$ export CONFIG_FILENAME=config.json $ flask run ``` diff --git a/brian_dashboard_manager/__init__.py b/brian_dashboard_manager/__init__.py index 1f4637c0d70f0d30547ca24be961e2c44d3a68e8..e929766837764b2469403562629410388d702957 100644 --- a/brian_dashboard_manager/__init__.py +++ b/brian_dashboard_manager/__init__.py @@ -15,19 +15,19 @@ CONFIG_KEY = 'CONFIG_PARAMS' def create_app(): """ overrides default settings with those found - in the file read from env var SETTINGS_FILENAME + in the file read from env var CONFIG_FILENAME :return: a new flask app instance """ - required_env_vars = ['SETTINGS_FILENAME'] + required_env_vars = ['CONFIG_FILENAME'] assert all([n in os.environ for n in required_env_vars]), \ 'environment variables %r must be defined' % required_env_vars app_config = config.defaults() - if 'SETTINGS_FILENAME' in os.environ: - with open(os.environ['SETTINGS_FILENAME']) as f: + if 'CONFIG_FILENAME' in os.environ: + with open(os.environ['CONFIG_FILENAME']) as f: app_config.update(config.load(f)) app = Flask(__name__) diff --git a/test/conftest.py b/test/conftest.py index 09de236391600e07f080295c84fbcf3fdee897e1..148685debfcb07b9863544c69595c9a85819730c 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -59,6 +59,6 @@ def data_config_filename(data_config): @pytest.fixture def client(data_config_filename): - os.environ['SETTINGS_FILENAME'] = data_config_filename + os.environ['CONFIG_FILENAME'] = data_config_filename with brian_dashboard_manager.create_app().test_client() as c: yield c