diff options
| -rw-r--r-- | main.py | 8 | ||||
| -rw-r--r-- | opendc/util/database.py | 3 | ||||
| -rw-r--r-- | opendc/util/rest.py | 2 |
3 files changed, 9 insertions, 4 deletions
@@ -12,8 +12,12 @@ from oauth2client import client, crypt from opendc.models.user import User from opendc.util import exceptions, rest +if len(sys.argv) < 2: + print "config file path not given as argument" + sys.exit(1) + # 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) STATIC_ROOT = os.path.join(KEYS['ROOT_DIR'], 'opendc-frontend', 'build') @@ -144,5 +148,5 @@ def receive_message(message): ) -SOCKET_IO_CORE.run(FLASK_CORE_APP, port=8081) +SOCKET_IO_CORE.run(FLASK_CORE_APP, host='0.0.0.0', port=8081) 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): |
