Blog code, this time with SQLALchemy. Requires Flask-SQLAlchemy and Flask-Debugtoolbar.