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