Flask (web framework)

Flask is a program written in Python micro - framework for developing Web applications. The focus of Flask is on expandability and good documentation. The only dependencies are Jinja2, a template engine, and tools, a library for creating WSGI applications.

Flask communicates via the WSGI interface, currently the current development for communication between Web servers and Web applications in the Python environment. For test purposes, and during the development of the supplied Flask web server can be used.

Unlike other frameworks, such as Django or Web2py, Flask provides no components available for which there are already solutions, but it also allows existing libraries easy to integrate. This allows the core functionality of Flask simple and minimal will be held. There are extensions for the most common functions, such as:

  • Handling of authentication, cookies, sessions
  • Configurable caching
  • Internationalization
  • An abstraction layer for databases that dynamically generated SQL (ORM, Object-Relational Mapper )
  • Compatible with many database management systems (currently Informix IDS, DB2, Drizzle, Firebird, SAP MaxDB, Microsoft Access, Microsoft SQL Server, MySQL, Oracle Database, PostgreSQL, SQLite, and Sybase ASE, MongoDB )

The development of Flask 2010 started as a April Fool's under the name Denied. Due to the surprisingly large amount of positive feedback Armin Ronacher started the project Flask.

A number of applications based on Flask. On the project homepage is an overview to find. The most important company that uses Flask, is Disqus. Moreover Flask with numerous platform-as - a-service services such as Google App Engine or Heroku compatible.

Example

The following code shows a simple Web application that prints Hello World on the home page:

From flask import Flask app = Flask ( __name__ )   @ app.route ( "/") def hello ():      return " Hello World"   if __ name__ == " __main__ ":      app.run () see also

  • Django (Python web framework )
  • TurboGears (Python Web framework that SQLAlchemy ORM used as default )
  • Web2py (Python web framework )
337382
de