#!/usr/bin/env python


def main():
    from blog.config import create_app, db
    from blog.models import Post

    app = create_app()
    with app.app_context():
        post1 = Post(
            title='Hello world!',
            body='Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
        )
        db.session.add(post1)

        post2 = Post(
            title='Hello world (again)!',
            body='Integer ullamcorper erat ac aliquam mollis.',
        )
        db.session.add(post2)
        db.session.commit()


if __name__ == '__main__':
    main()
