From 9d7d26c6573d83efeb5520054995d13077d1bca6 Mon Sep 17 00:00:00 2001 From: benjamyn Date: Tue, 18 Feb 2020 00:42:11 +1100 Subject: [PATCH] Added wsgi support --- shop.py | 14 +++++++------- wsgi.py | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 wsgi.py diff --git a/shop.py b/shop.py index a4714b8..1e6d97d 100644 --- a/shop.py +++ b/shop.py @@ -117,11 +117,11 @@ def get_list_ids(user_id): ret[lid] = name return ret -app = Flask(__name__) -app.config["DEBUG"] = True -app.secret_key = b'*$#@U9423jr92jioJKL_)_;dasfj()12' +application = Flask(__name__) +application.config["DEBUG"] = True +application.secret_key = b'*$#@U9423jr92jioJKL_)_;dasfj()12' -@app.route('/') +@application.route('/') def index(): if session.get('id') is None: data = {"title":"Login"} @@ -138,7 +138,7 @@ def index(): return render_template('mobile.html', data=data) return render_template('index.html', data=data) -@app.route('/post', methods=['POST']) +@application.route('/post', methods=['POST']) def handle_data(): if "addValue" in request.form: for x in request.form: @@ -189,7 +189,7 @@ def handle_data(): return redirect(url_for('index')) -@app.route("/admin") +@application.route("/admin") def admin(): if session.get('id') is None: data = {"title":"Login"} @@ -205,4 +205,4 @@ def admin(): if __name__ == '__main__': doesTableExist() - app.run(host="0.0.0.0") + application.run(host="0.0.0.0") diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..614be77 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,4 @@ +from shop import application + +if "__main__" == __name__: + application.run()