28 lines
693 B
Python
28 lines
693 B
Python
from flask import Flask, render_template, request, redirect, url_for
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route('/', methods=['GET','POST'])
|
|
def home():
|
|
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():
|
|
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__':
|
|
app.run(debug=True) |