use debug mode if FLASK_ENV is not 'production'

This commit is contained in:
2011-12-26 18:04:05 +00:00
parent 67529814e8
commit 9411285cc5

5
app.py
View File

@@ -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)