diff --git a/README.rst b/README.rst index 2473bee..abde29f 100644 --- a/README.rst +++ b/README.rst @@ -53,6 +53,8 @@ You can configure the following via environment variables. `SECRET_KEY` this should be a unique key that's used to sign key. This should be kept secret. See the `Flask Documentation`_ for more information. +`DEBUG` to run Flask web werver in debug mode. See the `Flask Documentation`_ for more information. + .. _Flask Documentation: http://flask.pocoo.org/docs/quickstart/#sessions `STATIC_URL` this should be the location of your static assets. You might not diff --git a/snappass/main.py b/snappass/main.py index 04e0ef6..9d05f54 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -10,6 +10,8 @@ from flask import abort, Flask, render_template, request NO_SSL = os.environ.get('NO_SSL', False) app = Flask(__name__) +if os.environ.get('DEBUG'): + app.debug = True app.secret_key = os.environ.get('SECRET_KEY', 'Secret Key') app.config.update( dict(STATIC_URL=os.environ.get('STATIC_URL', 'static'))) @@ -108,7 +110,7 @@ def show_password(password_key): @check_redis_alive def main(): - app.run(host='0.0.0.0', debug=True) + app.run(host='0.0.0.0') if __name__ == '__main__':