diff --git a/main.py b/main.py index 7ba4e1e..9dc3834 100644 --- a/main.py +++ b/main.py @@ -12,7 +12,12 @@ def get_data(): config = configparser.ConfigParser() config.read('config.ini') - es = Elasticsearch('https://{}:{}@40ad140d461d810ac41ed710b5c7a5b6.us-west-2.aws.found.io:9243/'.format(config['ELASTICSEARCH']['Username'], config['ELASTICSEARCH']['Password'])) + + host = os.environ.get('ELASTICSEARCH_HOST') + if host is None: + host = 'https://{}:{}@40ad140d461d810ac41ed710b5c7a5b6.us-west-2.aws.found.io:9243/'.format( + config['ELASTICSEARCH']['Username'], config['ELASTICSEARCH']['Password']) + es = Elasticsearch(host) # query week_ago = date.today() - timedelta(days=7) @@ -48,4 +53,4 @@ def filter(): return render_template('map.html', data=data) if __name__ == "__main__": - app.run(debug=True) \ No newline at end of file + app.run(debug=True)