#coding=utf-8 from flask import Flask from flask import request from flask import redirect app = Flask(__name__) @app.route("/home") def hello_world(): return "hello world" @app.route("/user", methods=["GET", "POST"]) def check_user(): if request.method == "GET": return "Please register first!" if request.method == "POST": user = request.form.get("user") return redirect("/home") if __name__ == '__main__': app.run(debug=True)