from flask import Flask, redirect, url_for, render_template, request app=Flask(__name__) @app.route("/") def home(): app.route('/') u_list = []; with open("user_list.txt") as u_file: for line in u_file: u_list.append(line); return render_template("index.html", u_list=u_list) def home2(name): # app.route('/home2/') # return redirect(url_for('home')) return render_template("home.html") def success(name): return "welcome %s" % name # this is a weird way to do this # right? def widg_fun(widg): if(widg.w_type == "input"): return "input id=id_%s name=%s type=text>', 'home2', home2) app.add_url_rule('/success/', 'success', success) app.add_url_rule('/login', 'login', login, methods = ['POST', 'GET']) app.add_url_rule('/req', 'req', req, methods = ['POST', 'GET']) app.run(host="104.248.118.130",debug=True)