diff --git a/server.py b/server.py
index 5ca06ad20315411e543fcafe697c7aaf06d8bf6b..2442fcf3ae40b91c0e5fee0ae60dc82200a136d6 100755
--- a/server.py
+++ b/server.py
@@ -2,9 +2,10 @@
 from flask import Flask, render_template, g
 import mysql.connector
 import sqlite3
-import config
 
 app = Flask(__name__)
+config = app.config
+config.from_pyfile('config.py')
 
 # Row wrapper for sqlite
 def dict_factory(cursor, row):
@@ -17,15 +18,15 @@ def dict_factory(cursor, row):
 	return d
 
 def query(operation, *params):
-	if config.db_engine == 'mysql':
+	if config['DB_ENGINE'] == 'mysql':
 		if 'db' not in g or not g.db.is_connected():
-			g.db = mysql.connector.connect(user=config.db_user, password=config.db_passwd, host=config.db_host, database=config.db_db)
+			g.db = mysql.connector.connect(user=config['MYSQL_USER'], password=config['MYSQL_PASSWD'], host=config['MYSQL_HOST'], database=config['MYSQL_DB'])
 		cur = g.db.cursor(dictionary=True)
 		cur.execute(operation.replace('?', '%s'), params)
 		return cur.fetchall()
-	else:
+	elif config['DB_ENGINE'] == 'sqlite':
 		if 'db' not in g or not g.db.is_connected():
-			g.db = sqlite3.connect(config.db_file)
+			g.db = sqlite3.connect(config['SQLITE_DB'])
 			g.db.row_factory = dict_factory
 		cur = g.db.cursor()
 		cur.execute(operation, params)
@@ -57,5 +58,4 @@ def play():
 	return render_template('play.html',  active_page='play')
 
 if __name__ == '__main__':
-	app.debug = True
 	app.run()