Add config file. #39

Merged
mattbk merged 2 commits from add-config into master 2017-12-08 22:48:10 -06:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit 06c9e9357a - Show all commits

2
config.ini Normal file
View File

@ -0,0 +1,2 @@
[DEFAULT]
PORT = 8080

View File

@ -51,8 +51,13 @@ import arrow
import json import json
import plotly import plotly
import sqlite3 import sqlite3
import ConfigParser
from plotly.graph_objs import * from plotly.graph_objs import *
config = ConfigParser.ConfigParser()
config.read("config.ini")
port = config.getint('DEFAULT', 'PORT')
app = Flask(__name__) app = Flask(__name__)
app.debug = True # Make this False if you are no longer debugging app.debug = True # Make this False if you are no longer debugging
@ -217,4 +222,4 @@ def validate_date(d):
return False return False
if __name__ == "__main__": if __name__ == "__main__":
app.run(host='0.0.0.0', port=8080) app.run(host='0.0.0.0', port=port)