Frage und Pinnwand Versuch
This commit is contained in:
parent
8de7fa76e1
commit
dbd83b4edd
1 changed files with 15 additions and 0 deletions
15
app/app.py
15
app/app.py
|
|
@ -15,5 +15,20 @@ def pinnwand():
|
|||
'<form method="post"><input name="nachricht">' \
|
||||
'<button>Senden</button></form><ul>' + liste + '</ul>'
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hallo aus meiner Flask-App!"
|
||||
|
||||
@app.route("/frage", methods=["GET", "POST"])
|
||||
def frage():
|
||||
if request.method == "POST":
|
||||
if request.form["antwort"] == "8":
|
||||
return "Richtig!"
|
||||
return "Leider falsch."
|
||||
return '<form method="post">Was ist 3 + 5? ' \
|
||||
'<input name="antwort"><button>OK</button></form>'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=9008)
|
||||
Loading…
Reference in a new issue