Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. from flask import Flask, render_template
  2. app = Flask(__name__)
  3.  
  4. from flask_wtf import FlaskForm
  5. from wtforms import TextField
  6. class contactForm(FlaskForm):
  7.     name=TextField("textfield")
  8.  
  9. form=contactForm(csrf_enabled=False) #trying to access this object
  10.  
  11. @app.route("/wtf", methods=["get", "post"])
  12. def formView(form):
  13.     return render_template("form.htm", form=form) #here
  14.  
  15. @app.route("/abc", methods=["get", "post"])
  16. def formReturn():
  17.     return(a)
  18.  
  19. if __name__ == "__main__":
  20.     app.run(debug = True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement