From f4c861635daea34eab30970c85f008e107c49379 Mon Sep 17 00:00:00 2001 From: Emory P Date: Fri, 6 Dec 2013 03:30:40 -0500 Subject: [PATCH] debug mode only for db echo on cli --- .gitignore | 2 +- db.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 97976e2..9f2e8e9 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.pyc *.swp start_server.sh -*.log +*.log* diff --git a/db.py b/db.py index 389148d..dd5d7e9 100755 --- a/db.py +++ b/db.py @@ -15,7 +15,10 @@ import os.path Base = declarative_base() -engine = create_engine(config.get('base', 'database_uri'), convert_unicode = True, echo = True) +if config.get('base', 'debug'): + engine = create_engine(config.get('base', 'database_uri'), convert_unicode = True, echo = True) +else: + engine = create_engine(config.get('base', 'database_uri'), convert_unicode = True) session = scoped_session(sessionmaker(autoflush = False, bind = engine))