Verlinkung mit finaler Seite eingebaut

This commit is contained in:
2024-01-14 22:08:10 +01:00
parent a1ee5f3ea0
commit fdac7b05ea
4 changed files with 48 additions and 7 deletions

21
app.py
View File

@@ -1,14 +1,27 @@
from flask import Flask, render_template
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
@app.route('/')
@app.route('/', methods=['GET','POST'])
def home():
return render_template('index.html')
if request.method == 'GET':
return render_template('index.html')
if request.method == 'POST':
return redirect(url_for('form'))
@app.route ('/form', methods=['GET','POST'])
def form():
return render_template('form.html')
if request.method == 'GET':
return render_template('form.html')
if request.method == 'POST':
user = request.form['name']
return redirect(url_for('submitted'))
@app.route ('/submitted')
def submitted():
return render_template('submitted.html')
if __name__ == '__main__':