mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-10-30 19:29:58 +00:00
More forms testing
This commit is contained in:
12
run.py
12
run.py
@@ -13,14 +13,16 @@ def index():
|
||||
return "<h1>This is the default page</h1>"
|
||||
|
||||
|
||||
@app.route("/forms")
|
||||
@app.route("/forms", methods=["GET", "POST"])
|
||||
def forms():
|
||||
service_form = ServiceForm()
|
||||
form = ServiceForm()
|
||||
|
||||
if service_form.validate_on_submit: # type: ignore
|
||||
session["name"]
|
||||
if form.validate_on_submit: # type: ignore
|
||||
session["name"] = form.name.data
|
||||
session["url"] = form.url.data
|
||||
|
||||
return render_template("forms.html", form=service_form)
|
||||
form = ServiceForm(formdata=None)
|
||||
return render_template("forms.html", form=form)
|
||||
|
||||
|
||||
# Prevent execution when imported by other script
|
||||
|
||||
Reference in New Issue
Block a user