Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, render_template, request
- app = Flask(__name__)
- #serve up the main page (index)
- @app.route("/")
- def index():
- return render_template("index.html")
- @app.route("/collect", methods=['GET', 'POST'])
- def collect():
- #get the POSTed data
- dog = request.form['dog']
- sport = request.form['sport']
- town = request.form['town']
- vaca = request.form['vaca']
- #robot = request.form['robot']
- if 'robot' not in request.form:
- return("You are a robot. Ignored")
- #save the data into file
- #return HTML response page
- return("done") #browser
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement