Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask,render_template,request
- import os
- app = Flask(__name__)
- APP_ROOT = os.path.dirname(os.path.abspath(__file__)) # refers to application_top
- APP_STATIC = os.path.join(APP_ROOT, 'static')
- @app.route('/')
- def init():
- return open('index.html').read()
- @app.route('/someLink', methods=['POST','GET'])
- def someLink():
- print "Reached Python code finally!"
- print request.data;
- print request.args;
- print request.form;
- print request.files;
- print request.values;
- return "Batman"
- if __name__ == "__main__":
- app.run(host='localhost', port=8080)
Add Comment
Please, Sign In to add comment