DEBUG flag can now be set via config and environment
This commit is contained in:
parent
b02938cafe
commit
958a9bdd9f
7
main.py
7
main.py
|
@ -1,12 +1,17 @@
|
|||
import os
|
||||
from app import app
|
||||
import logging
|
||||
from config import config
|
||||
|
||||
|
||||
def setup_logging():
|
||||
logging.basicConfig(format='%(asctime)s [%(levelname)s]: %(message)s', level=logging.INFO)
|
||||
|
||||
if __name__ == '__main__':
|
||||
DEBUG = 'DEBUG' in os.environ and os.environ['DEBUG'] != 'False'
|
||||
c = config[os.getenv('FLASK_CONFIG') or 'default']
|
||||
|
||||
DEBUG = c.DEBUG
|
||||
DEBUG = os.environ.get('DEBUG', DEBUG)
|
||||
|
||||
setup_logging()
|
||||
app.run(debug=DEBUG, host='0.0.0.0')
|
||||
|
|
Loading…
Reference in New Issue