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.readlines(): u_list.append(line.strip()); return render_template("index.html", u_list=u_list, page_name="home") def rules(): return render_template("rules.html") 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> 1): is_email_user = True print(username + " " + email + " " + shell + " " + rule_read) return render_template("signup.html", is_email_user = is_email_user) def login(): if request.method == "POST": user = request.form["nm"] return redirect(url_for('success', name = user)) else: return redirect(url_for('home')) if __name__=="__main__": app.add_url_rule('/home2/', 'home2', home2) app.add_url_rule('/rules', 'rules', rules) 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.add_url_rule('/req/signup', 'signup', signup, methods = ['POST']) app.run(host="104.248.118.130",debug=True)