pinnwand fix
This commit is contained in:
parent
cc15726485
commit
184ac2fb37
1 changed files with 13 additions and 1 deletions
14
app/app.py
14
app/app.py
|
|
@ -1,4 +1,4 @@
|
|||
from flask import Flask, request
|
||||
from flask import Flask, request, redirect
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
|
@ -15,5 +15,17 @@ def frage():
|
|||
return '<form method="post">Was ist 3 + 5? ' \
|
||||
'<input name="antwort"><button>OK</button></form>'
|
||||
|
||||
@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=9008) # 90 + Raumnummer (Wir: 08)
|
||||
Loading…
Reference in a new issue