From 9411285cc54c038bf1c06ae9e9a559d5f0fb8eeb Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 26 Dec 2011 18:04:05 +0000 Subject: [PATCH] use debug mode if FLASK_ENV is not 'production' --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index b751440..50d3f8b 100644 --- a/app.py +++ b/app.py @@ -45,5 +45,6 @@ def api_highlight(): if __name__ == '__main__': - port = int(os.environ.get("PORT", 5000)) - app.run(host='0.0.0.0', port=port) + port = int(os.environ.get('PORT', 5000)) + use_debug = os.environ.get('FLASK_ENV', 'development') != 'production' + app.run(host='0.0.0.0', port=port, debug=use_debug)