From 532ecf39611113ac59b084935f68016bd353e73f Mon Sep 17 00:00:00 2001 From: Sacheendra Talluri Date: Wed, 25 Jan 2017 16:17:36 +0100 Subject: makes the app take config file as command line argument and opens port on all interfaces instead of localhost --- opendc/util/database.py | 3 ++- opendc/util/rest.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'opendc') diff --git a/opendc/util/database.py b/opendc/util/database.py index 16fff5f0..2ef8b982 100644 --- a/opendc/util/database.py +++ b/opendc/util/database.py @@ -1,9 +1,10 @@ from datetime import datetime import json import sqlite3 +import sys # Get keys from config file -with open('/var/www/opendc.ewi.tudelft.nl/web-server/config/keys.json') as file: +with open(sys.argv[1]) as file: KEYS = json.load(file) DATETIME_STRING_FORMAT = '%Y-%m-%dT%H:%M:%S' diff --git a/opendc/util/rest.py b/opendc/util/rest.py index a52b0082..65747762 100644 --- a/opendc/util/rest.py +++ b/opendc/util/rest.py @@ -7,7 +7,7 @@ from oauth2client import client, crypt from opendc.util import exceptions, parameter_checker -with open('/var/www/opendc.ewi.tudelft.nl/web-server/config/keys.json') as file: +with open(sys.argv[1]) as file: KEYS = json.load(file) class Request(object): -- cgit v1.2.3