@app.route('/user', methods=['GET', 'POST'])
def login():
    if (request.method == 'POST'):
        username = request.form['username']
        password = request.form['password']
        if ((username == 'user') and (password == 'password')):
            return redirect('http://www.baidu.com')
        else:
            message = 'Failed Login'
            return render_template('login.html', message=message)
    return render_template('login.html')
@app.route('/user', methods=['GET', 'POST'])
def login():
    if (request.method == 'POST'):
        username = request.form['username']
        password = request.form['password']
        if ((username == 'user') and (password == 'password')):
            return redirect('http://www.baidu.com')
        else:
            message = 'Failed Login'
            return render_template('login.html', message=message)
    return render_template('login.html')