summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorSacheendra Talluri <sacheendra.t@gmail.com>2017-08-09 00:20:54 +0200
committerSacheendra Talluri <sacheendra.t@gmail.com>2017-08-09 00:20:54 +0200
commit777cb36dfb130af38fe095de6140b4a08883570d (patch)
tree81f8c23f72a951a40e4644b664d950c6f2d7ea05 /main.py
parent5d42f30ed30aa5b6970304569c6bd01c16078759 (diff)
Migrate to MariaDB
Diffstat (limited to 'main.py')
-rw-r--r--main.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.py b/main.py
index 3dbb2a53..c94f9ab7 100644
--- a/main.py
+++ b/main.py
@@ -10,7 +10,7 @@ import flask_socketio
from oauth2client import client, crypt
from opendc.models.user import User
-from opendc.util import exceptions, rest, path_parser
+from opendc.util import exceptions, rest, path_parser, database
if len(sys.argv) < 2:
print "config file path not given as argument"
@@ -22,6 +22,9 @@ with open(sys.argv[1]) as file:
STATIC_ROOT = os.path.join(KEYS['ROOT_DIR'], 'opendc-frontend', 'build')
+database.init_connection_pool(user=KEYS['MYSQL_USER'], password=KEYS['MYSQL_PASSWORD'], \
+ database=KEYS['MYSQL_DATABASE'], host=KEYS['MYSQL_HOST'], port=KEYS['MYSQL_PORT'])
+
FLASK_CORE_APP = Flask(__name__, static_url_path='')
FLASK_CORE_APP.config['SECREY_KEY'] = KEYS['FLASK_SECRET']
@@ -196,4 +199,4 @@ def _process_message(message):
return (request, response)
-SOCKET_IO_CORE.run(FLASK_CORE_APP, host='0.0.0.0', port=8081)
+SOCKET_IO_CORE.run(FLASK_CORE_APP, host='0.0.0.0', port=8082)