@auth.route('/login', methods=['GET', 'POST'])
def login():

    error = None
    if request.method == 'POST':
        u = UsersTable.query\
        .filter(UsersTable.username == request.form['username'])\
        .filter(UsersTable.password == request.form['password'])\
        .filter(UsersTable.is_private == False)\
        .first()
        if u:
            session['logged_in_user'] = u.id
            session['user_name'] = u.name
            flash('You were logged in')
            return redirect(url_for('dashboard.index'))
        else:
            error = 'Invalid username and/or password'
    return render_template('login.html', error=error)
Some ipython tests with fully random output.
dataset/ETHPy150Open radekstepan/FlaskBudget/presenters/auth.py/login--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/testing/plugin/dtexample.py/iprand_all