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.') session.configure(bind=engine) Base.metadata.create_all(engine)
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.') session.configure(bind=engine) user = User() user.name = 'Kelp' user.email = '*****@*****.**' user.password = utils.hash_password('12345') user.save() transaction.commit()