Skip to content

Flask | Cookbook



$ pip install flask
$ flask --version
Python 3.7.3
Flask 1.1.1
Werkzeug 0.15.5

Creating a App

Create base python script

from flask import Flask

app = Flask(__name__)

def example():
   return '{"name":"Bob"}'

if __name__ == '__main__':

Start Flask

flask run
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on (Press CTRL+C to quit) - - [01/Aug/2019 12:19:00] "GET / HTTP/1.1" 200 - - - [01/Aug/2019 12:19:00] "GET /favicon.ico HTTP/1.1" 404 -

Leave a Reply

Your email address will not be published. Required fields are marked *