Flask: Difference between revisions

From Network Security Wiki
Content added Content deleted
m (Protected "Flask" ([Edit=Allow only logged in users] (indefinite) [Move=Allow only logged in users] (indefinite) [Delete=Allow only logged in users] (indefinite)))
No edit summary
Line 17:
Access the above app from:
http://127.0.0.1:5000/
 
Enable Debugging & access URL over network:
app.run(debug = True, host= '0.0.0.0')

Revision as of 15:12, 13 June 2018

Installation:

pip3 install flask

Hello World:

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
   return 'Hello World’

if __name__ == '__main__':
   app.run()

Access the above app from:

http://127.0.0.1:5000/

Enable Debugging & access URL over network:

app.run(debug = True, host= '0.0.0.0')