from flask import render_template, request
from testapp import app
@app.route("/form", methods=["GET", "POST"])
def index():
if request.method == "GET":
return render_template("testapp/index.html")
if request.method == "POST":
print("POSTデータ受け取ったので処理します。")
data = request.form["text"]
print(data)
return render_template("testapp/index.html")
# @app.route("/test")
# def index2():
# my_dict = {
# "insert_something1": "views.pyのinsert_something1部分です。",
# "insert_something2": "views.pyのinsert_something2部分です。",
# }
# return render_template("testapp/index.html", my_dict=my_dict)