shashwat2

app.py

Mar 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. from flask import Flask,render_template,request
  2. import os
  3.  
  4. app = Flask(__name__)
  5. APP_ROOT = os.path.dirname(os.path.abspath(__file__)) # refers to application_top
  6. APP_STATIC = os.path.join(APP_ROOT, 'static')
  7.  
  8. @app.route('/')
  9. def init():
  10. return open('index.html').read()
  11.  
  12. @app.route('/someLink', methods=['POST','GET'])
  13. def someLink():
  14. print "Reached Python code finally!"
  15. print request.data;
  16. print request.args;
  17. print request.form;
  18. print request.files;
  19. print request.values;
  20. return "Batman"
  21.  
  22. if __name__ == "__main__":
  23. app.run(host='localhost', port=8080)
Add Comment
Please, Sign In to add comment