@app.before_first_request
def setup():
    Base.metadata.drop_all(bind=db.engine)
Base.metadata.create_all(bind=db.engine)
db.session.add(User('Bob Jones', 'bob@gmail.com'))
db.session.add(User('Joe Quimby', 'eat@joes.com'))
db.session.commit()

@app.route('/')
def root():
    users = db.session.query(User).all()
return '<br>'.join(['{0}: {1}'.format(user.name, user.email) for user in
    users])
if __name__ == '__main__':
    app.run('127.0.0.1', 5000)
How to use flask-sqlalchemy with existing sqlalchemy model?