Run in production mode by default

Use DEBUG environment variable to run debug mode
This commit is contained in:
Joseph Boiteau 2016-12-20 15:24:26 +11:00
parent addd1495a3
commit d61c08c7c7
No known key found for this signature in database
GPG key ID: 03569E835707F0B0
2 changed files with 5 additions and 1 deletions

View file

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

View file

@ -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__':