ahmedraza

register.py

Feb 10th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. @app.route("/register", methods=["GET","POST"])
  2. def register():
  3.     if request.form["username"] == "" or request.form["password"] == "":
  4.         return render_template("apology.html")
  5.     if request.form["password"] == request.form["again_password"]:
  6.             db.execute("INSERT INTO finance (username, password) VALUES(:username, :password)", username=request.form["username"], password=request.form["password"])
  7.     print ("Both passwords don't match")
  8.     return redirect(url_for("register.html", next=request.url))
Add Comment
Please, Sign In to add comment