Example #1
0
def main(argv=sys.argv):
    if len(argv) != 2:
        usage(argv)
    config_uri = argv[1]
    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)
    Base.metadata.create_all(engine)
    with transaction.manager:
        model = Posting(title='First flog post', text='*This* is a new flog post.')
        DBSession.add(model)

    with transaction.manager:
        model = Settings(
                title='This is a new *flog*',
                about='h1. About me\n\nI don\'t have to say anything about me.',
                user='******',
                password='******')
        DBSession.add(model)