diff --git a/app-ajax.py b/app-ajax.py index 9cddfbb..661f13f 100755 --- a/app-ajax.py +++ b/app-ajax.py @@ -7,11 +7,16 @@ import configparser import json import appdb, appsms from flask import Flask, render_template, request -app = Flask(__name__) -app.debug = True config = configparser.ConfigParser() config.read('config.ini') +app_debug = config.get("app","debug") + +app = Flask(__name__) +if app_debug == '1': + app.debug = True +else: + app.debug = False @app.route('/') def index(): diff --git a/callback-sms.py b/callback-sms.py index a67ea73..fb0b86d 100755 --- a/callback-sms.py +++ b/callback-sms.py @@ -21,8 +21,9 @@ app = Flask(__name__) ######### # This is so bare I don't need a config right now. -#config = configparser.ConfigParser() -#config.read('config.ini') +config = configparser.ConfigParser() +config.read('config.ini') +app_debug = config.get("app","debug") ############################# ## Callback defs go here @@ -60,7 +61,10 @@ def deliveryReport(): ################# ## Main loop if __name__ == '__main__': - app.debug = True + if app_debug == '1': + app.debug = True + else: + app.debug = False app.run( host="0.0.0.0", port=8790 diff --git a/config-sample.ini b/config-sample.ini index 9866426..303f7ae 100644 --- a/config-sample.ini +++ b/config-sample.ini @@ -9,4 +9,7 @@ fr_access_key=12345 fr_secret_key=sample [phone] -source=12135551212 \ No newline at end of file +source=12135551212 + +[app] +debug=1 ;1 for true and anything else for false. \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index a07372e..d4a497a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -10,109 +10,11 @@