23 lines
No EOL
736 B
Python
23 lines
No EOL
736 B
Python
<<<<<<< HEAD
|
|
from flask import Flask, request, redirect
|
|
=======
|
|
from flask import Flask, request
|
|
>>>>>>> cc1572648571daae5f23f95b3bf9711011ffca50
|
|
|
|
app = Flask(__name__)
|
|
eintraege = [] # speichert die Nachrichten (im Arbeitsspeicher)
|
|
|
|
@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) |