@app.teardown_appcontext def shotdown_session(exception=None): db.session.remove()