As one of the more popular Python frameworks, Flask is an extremely lightweight yet powerful system for web applications. Seen as more of a micro framework, a functional Flask application can be as simple as 20 lines of code.

As one of the more popular Python frameworks, Flask is an extremely lightweight yet powerful system for web applications. Seen as more of a micro framework, a functional Flask application can be as simple as 20 lines of code.
This recipe is based on a very simple, single file Flask application. To show the simplicity, here's the example (demoapp.py) we'll use:
from flask import Flask application = Flask(__name__) @application.route("/") def hello(): return "<h1>Demo via Nginx with uWSGI!</h1>" if __name__ == "__main__": application.run(host='127.0.0.1', port=9001)
Like the Django recipe, we're going to...