Verlinkung mit finaler Seite eingebaut
This commit is contained in:
21
app.py
21
app.py
@@ -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__':
|
||||
|
||||
Reference in New Issue
Block a user