@app.route('/add', methods=['POST'])
def add_entry():
    if not session.get('logged_in'):
        abort(401)
    new_entry = models.Flaskr(request.form['title'], request.form['text'])
    db.session.add(new_entry)
    db.session.commit()
    flash('New entry was successfully posted')
    return redirect(url_for('index'))
Adds new post to the database.
dataset/ETHPy150Open Akagi201/learning-python/flask/flaskr-tdd/app.py/add_entry