This commit is contained in:
Tahar Lamred & Theresa Nerz 2026-06-19 14:10:04 +02:00
parent 41a663eade
commit 09465d675a

View file

@ -15,5 +15,19 @@ def frage():
return '<form method="post">Was ist 3 + 5? ' \
'<input name="antwort"><button>OK</button></form>'
eintraege = []
@app.route("/pinnwand", methods=["GET", "POST"])
def pinnwand():
if request.method == "POST":
eintraege.append(request.form["nachricht"])
return redirect("/app/pinnwand")
liste = ""
for e in eintraege:
liste = liste + "<li>" + e + "</li>"
return '<h1>Pinnwand</h1>' \
'<form method="post"><input name="nachricht">' \
'<button>Senden</button></form><ul>' + liste + '</ul>'
if __name__ == "__main__":
app.run(host="0.0.0.0", port=9003)