Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Created November 3, 2015 22:08
Show Gist options
  • Save IuryAlves/31ac99e6ee064571a371 to your computer and use it in GitHub Desktop.
Save IuryAlves/31ac99e6ee064571a371 to your computer and use it in GitHub Desktop.
# coding: utf-8
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route("/send", methods=["POST"])
def send():
return request.form["data"]
@app.route("/")
def index():
# o arquivo form.html deve estar dentro da pasta templates
return render_template("form.html")
if __name__ == '__main__':
app.run()
<html>
<head>
</head>
<body>
<form method="POST" action="/send">
<input name="data">
<input type="submit" value="data"/>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment