Advertisement
tomateblue

AppFormularioBasic.py

Nov 19th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. from flask import Flask,render_template, request
  4.  
  5.  
  6. app = Flask(__name__)
  7.  
  8. @app.route("/",methods=['POST','GET'])
  9. def get_formulario():
  10.  if request.method == "POST":
  11.   if request.form['submit'] == "Enviar":
  12.     txt = request.form['text'].encode('ascii','ignore')
  13.     print "*" * 50
  14.     print "**\t\t Submit text -> ",txt,"\t"+("*" * 2)
  15.     print "*" * 50
  16.  return render_template("index.html")
  17.  
  18. if __name__ == "__main__":
  19.  app.run(host="0.0.0.0",port=80,debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement