Add debugging.
This commit is contained in:
parent
3708fc637a
commit
968e8b5976
@ -16,11 +16,21 @@
|
|||||||
"""
|
"""
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask.ext.sqlalchemy import SQLAlchemy
|
from flask.ext.sqlalchemy import SQLAlchemy
|
||||||
|
|
||||||
from . import config
|
from . import config
|
||||||
|
|
||||||
|
logging.basicConfig()
|
||||||
|
|
||||||
|
if config.debug:
|
||||||
|
logging.getLogger().setLevel(logging.DEBUG)
|
||||||
|
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
|
||||||
|
else:
|
||||||
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
|
|
||||||
# The app
|
# The app
|
||||||
app = Flask(__name__, static_folder=None)
|
app = Flask(__name__, static_folder=None)
|
||||||
|
|
||||||
@ -29,6 +39,8 @@ app.config['SQLALCHEMY_RECORD_QUERIES'] = config.debug
|
|||||||
app.config['WTF_CSRF_ENABLED'] = False
|
app.config['WTF_CSRF_ENABLED'] = False
|
||||||
app.config['SECRET_KEY'] = 'my_secret_key'
|
app.config['SECRET_KEY'] = 'my_secret_key'
|
||||||
|
|
||||||
|
app.debug = config.debug
|
||||||
|
|
||||||
db = SQLAlchemy(app)
|
db = SQLAlchemy(app)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# Daabase connection URI
|
||||||
db_uri='postgresql://accountant:accountant@localhost/accountant'
|
db_uri='postgresql://accountant:accountant@localhost/accountant'
|
||||||
|
|
||||||
|
# Debug
|
||||||
debug=True
|
debug=True
|
||||||
|
Loading…
Reference in New Issue
Block a user