Flask Python Framework
Flask is a Python framework, based on Werkzeug, Jinja2 and inspired by Sinatra Ruby framework, available under BSD licence. It was developed at pocoo by Armin Ronacher. Although Flask is rather young compared to most Python frameworks, it holds a great promise and has already gained popularity among Python web developers. Let’s take a closer look into Flask, so-called “micro” framework for Python.
Flask was designed to be easy to use and extend. The idea behind Flask is to build a solid foundation for web applications of different complexity. From then on you are free to plug in any extensions you think you need. Also you are free to build your own modules. Flask is great for all kinds of projects. It's especially good for prototyping. Flask depends on two external libraries: the Jinja2 template engine and the Werkzeug WSGI toolkit.
Still the question remains why use Flask as your web application framework if we have immensely powerful Django, Pyramid, and don’t forget web megaframework Turbogears? Those are supreme Python web frameworks BUT out-of-the-box Flask is pretty impressive too with its:
- built-in development server and fast debugger
- integrated support for unit testing
- RESTful request dispatching
- Jinja2 templating
- support for secure cookies (client side sessions)
- WSGI 1.0 compliant
- Unicode based
Plus Flask gives you so much more CONTROL on the development stage of your project. It follows the principles of minimalism and let’s you decide how you will build your application.
- Flask has a lightweight and modular design, so it easy to transform it to the web framework you need with a few extensions without weighing it down
- ORM-agnostic: you can plug in your favourite ORM e.g. SQLAlchemy.
- Basic foundation API is nicely shaped and coherent.
- Flask documentation is comprehensive, full of examples and well structured. You can even try out some sample application to really get a feel of Flask.
- It is super easy to deploy Flask in production (Flask is 100% WSGI 1.0 compliant”)
- HTTP request handling functionality
- High Flexibility
The configuration is even more flexible than that of Django, giving you plenty of solution for every production need.
To sum up, Flask is one of the most polished and feature-rich micro frameworks available. Still young, Flask has a thriving community, first-class extensions, and an elegant API. Flask comes with all the benefits of fast templates, strong WSGI features, thorough unit testability at the web application and library level, extensive documentation. So next time you are starting a new project where you need some good features and a vast number of extensions, definitely check out Flask.