# ...
# same as above
@app.route('/welcome/<name>')
def welcome(name):
return render_template('main.html', name=name)
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
# ...
# check for valid login, assign username
...