Flask is a micro web framework which is really fun to use. With the following snippet You have a complete web app working within seconds.
from flask import Flask # 1 app = Flask(__name__) # 2 @app.route('/') # 3 def hello_world(): return 'Hello World!' if __name__ == '__main__': app.run() #4
All this snippet does is
- Importing the Flask module,
- Creating the app,
- Defining an so called endpoint and finally
- Running the web app in a container.
Flask brings its own WSGI server called “werkzeug”. Please use it just for development purposes. It is not suitable for live applications. Continue reading “Bringing AJAX to Flask – Part 1”