Thursday, May 23, 2013

Developing websites "the UNIX way" using Python and Flask

by Jos Vos (X/OS Experts in Open Systems BV)

Thursday, 23.05.2013, New York II, 14:45-15:30 Uhr

For many years database-driven web frameworks have gained popularity. Ruby on Rails, CakePHP, and Django (Python) are the main players in this area. Most frameworks are big, monolithic environments, trying to solve all problems with one chunk of software.

For UNIX-minded people, Python is often considered a good choice whereby Django automatically enters the picture as the preferred framework. However, Django is, like most others, an attempt to do everything with one piece of software. It contains its own URL dispatcher, object-relational mapper (ORM), templating engine, and more. Some components can be replaced by alternatives, but this is not always easy and often not recommended.

Flask, in contrast, is a micro web development framework not aiming to solve all problems itself, but it can (and has to) be combined easily with the best tools that solve a certain problem on their own. Just like the philosophy of solving problems the UNIX way, by combining multiple small tools, each specialized in doing a particular task.

Flask is typically used in combination with Werkzeug (a WSGI utility libabry), SQLAlchemy (by many considered as the most powerful Python ORM) and Jinja2 (a templating engine). With this combination you can build web applications using a selection of the most powerful components in the Python world.

Not only is a Flask-based collection of tools more powerful, it is also easier to use, as the components are loosely coupled making them easier to understand and use. It is possble to write a simple database-driven web application with only a small piece of Python code, and a couple of template files.

This talk will show how easy it is to start developing a web application based on Flask and it will summarize some pro's and con's, compared to more common monolithic frameworks.

About the author Jos Vos:

Jos Vos is owner/co-founder of X/OS Experts in Open Systems BV.
He has more than 25 years of experience in research, development and
consulting in the field of systems software, Internet and security.
UNIX has been central in his academic and professional life, he feels
privileged for never having used a Windows machine so far.

His operating system of choice since 1994 is Linux. In the Linux
community he is best known for writing ipfwadm and part of the
firewall code in the 2.0 kernel. He also was the core developer
of X/OS Linux, a freely available enterprise-class distribution
based on the Red Hat Enterprise Linux sources.

His company X/OS acts as a knowledge partner, working together with
clients on projects that require in-depth knowledge of UNIX and Open
Source. Consulting work deals primarily with IT architectures,
advanced system administration topics and integration issues. It is
often combined with custom software development to implement a
tailor-made solution for the client, from glue code to complete
applications.

In addition to sharing knowledge, X/OS offers open, standards-based
solutions built on top of Linux and Open Source software. Products
include customizable firewall/VPN appliances, point-of-sale terminals,
high-availability clusters and Linux support services.