Ejemplo n.º 1
0
def login():
    """
    Route for url: server/login/
    """
    form = LoginForm()
    if request.method == 'GET':
        return render_template('login.html', form = form)

    if request.method == 'POST':
        if form.authenticate():
            session['username'] = form.username.data
            return redirect(url_for('home'))
        flash('Incorrect username / password combination. Please try again.')
        return render_template('login.html', form = form)