summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/app.py b/app.py
index c35c130..0871e26 100644
--- a/app.py
+++ b/app.py
@@ -4,6 +4,7 @@ import sqlite3
import hashlib
import os
import re
+import json
import datetime
from flask import (
Flask,
@@ -17,7 +18,6 @@ from flask import (
session,
flash
)
-from config import config
class Markup(object):
@@ -513,7 +513,7 @@ class DBProxy(object):
def db():
database = getattr(g, "_database", None)
if database is None:
- database = g._database = DBProxy("votes.db",
+ database = g._database = DBProxy(config['database'],
config['superuser'].lower())
return database
@@ -677,6 +677,14 @@ def get_static(path):
def robotstxt():
return send_from_directory('static', 'robots.txt')
+if 'VOTE_CONFIG' in os.environ:
+ configf = open(os.environ['VOTE_CONFIG'])
+else:
+ configf = open('config.json')
+
+config = json.load(configf)
+configf.close()
+
app.debug = config['debug']
app.secret_key = config['secret_key']
if __name__ == '__main__':