1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-14 14:12:17 +00:00

debug mode only for db echo on cli

This commit is contained in:
Emory P 2013-12-06 03:30:40 -05:00
parent 74dbeca76b
commit f4c861635d
2 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
*.pyc
*.swp
start_server.sh
*.log
*.log*

5
db.py
View File

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