Я создаю приложение flask с psql. Код ниже дает мне nameError: 'surname' не определено. Мне нужна помощь.
@app.route("/success", methods=["POST"])
def success():
name = request.form.get("name")
db.execute("INSERT INTO users (surname, firstname, email, username, pass_word) VALUES (:surname, :firstname, :email, :username, :pass_word)",
{"surname":surname, "firstname":firstname, "email":email, "username":username, "pass_word":password})
db.commit()
return render_template("success.html", name=firstname)