|
|
@ -17,7 +17,7 @@ from flaskr.blueprints.flaskr import init_db |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_app(config=None): |
|
|
|
def create_app(config=None): |
|
|
|
app = Flask(__name__) |
|
|
|
app = Flask(__name__.split('.')[0]) |
|
|
|
|
|
|
|
|
|
|
|
app.config.update(dict( |
|
|
|
app.config.update(dict( |
|
|
|
DATABASE=os.path.join(app.root_path, 'flaskr.db'), |
|
|
|
DATABASE=os.path.join(app.root_path, 'flaskr.db'), |
|
|
@ -61,4 +61,4 @@ def register_teardowns(app): |
|
|
|
def close_db(error): |
|
|
|
def close_db(error): |
|
|
|
"""Closes the database again at the end of the request.""" |
|
|
|
"""Closes the database again at the end of the request.""" |
|
|
|
if hasattr(g, 'sqlite_db'): |
|
|
|
if hasattr(g, 'sqlite_db'): |
|
|
|
g.sqlite_db.close() |
|
|
|
g.sqlite_db.close() |
|
|
|