Browse Source

Fix with block

pull/858/head
Sean Vieira 11 years ago
parent
commit
12d6ec4130
  1. 2
      docs/tutorial/dbinit.rst

2
docs/tutorial/dbinit.rst

@ -25,7 +25,7 @@ database. Let me show you the code first. Just add that function below
the `connect_db` function in `flaskr.py`:: the `connect_db` function in `flaskr.py`::
def init_db(): def init_db():
app app.app_context(): with app.app_context():
db = get_db() db = get_db()
with app.open_resource('schema.sql', mode='r') as f: with app.open_resource('schema.sql', mode='r') as f:
db.cursor().executescript(f.read()) db.cursor().executescript(f.read())

Loading…
Cancel
Save