|
@@ -1,7 +1,14 @@
|
|
|
-from flask import Flask, render_template
|
|
|
|
|
|
|
+from flask import request, Flask, render_template
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
-@app.route('/')
|
|
|
|
|
|
|
+@app.route('/', methods=['GET', 'POST'])
|
|
|
def hello_world():
|
|
def hello_world():
|
|
|
- return render_template('index.html')
|
|
|
|
|
|
|
+ if request.method == 'GET':
|
|
|
|
|
+ return render_template('index.html')
|
|
|
|
|
+ elif request.method == 'POST':
|
|
|
|
|
+ return request.form
|
|
|
|
|
+
|
|
|
|
|
+@app.errorhandler(405)
|
|
|
|
|
+def method_not_allowed(e):
|
|
|
|
|
+ return render_template('405.html'), 405
|