I'm getting a Error 500 (-Internal error due to server overload) when I attempt to flask run for pset8-Finance.
Here is my app.route("/register")
@app.route("/register", methods=["GET", "POST"])
def register():
if request.method == "POST":
"""Register user"""
#Check for entered username and password
if not request.form.get("username"): #get username
return apology("Please enter a username.") #if username is blank
elif not request.form.get("password"): #get password - first attempt
return apology("Please provide a password.") # if password is blank
elif request.form.get("password") != request.form.get("confirmation"): #get password - second attempt
return apology("These passwords do not match.") #if password and confirmation do not match
# Hash password as per specs
hash = generate_password_hash(request.form.get("password"))
username = request.form.get("username")
new_user = db.execute("INSERT INTO users (username, hash)
#if not new_user:
#return apology("That username is taken, please choose another.")
session["user_id"] = new_user
sflash("You have successfully registered!")
return redirect(url_for("index"))
else:
return render_template("register.html")