Exploring the Flask web framework in Python

Hip Flask

Article from Issue 169/2014
Author(s):

The Flask micro framework emerged from an April Fool's prank, but this simple and easy web development aid is no joke.

Developers who are looking for a Python web framework often turn to the popular Django framework [1], but Django isn't the best choice for every situation. For instance, developers occasionally face tasks that are very difficult to solve with Django's object relational mapper (ORM) or that require additional applications or other frameworks. In some cases, the versatility of Django leads to a complexity that simply isn't needed for a quick and simple project. When less is actually more, a micro web framework such as Flask [2] is often a better option.

This article demonstrates the Flask web framework by putting it to work on a real-world web application: a handy little brainstorming tool known as Geistesblitze. The word Geistesblitze is German for brainstorms or flashes of genius. The tool consists of a web application with graphical Web UI for quickly capturing and associating ideas. This simple example will introduce you to the most important and interesting aspects of Flask. The complete code is available under a BSD license on GitHub [3].

April Fool!

In 2010, the Denied [4] micro web framework popped up on the web for the first time. Python developer Armin Ronacher published it as April Fool's day joke; he wanted to poke fun at the business model of various micro web frameworks that were popular at the time. He bundled all the code into a single file called deny.py and posted a badly programmed web page (Figure 1) with fake quotes. He also shot a movie with a Dutch friend posing as the French developer of Denied [5].

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • PostgreSQL

    PostgreSQL, an open source object-relational database management system known for its reliability and extensibility, offers a robust feature set. If you are new to PostgreSQL, we help you get started with some of its most useful features.

  • Alexa Skills

    Want to add voice activation to your IoT environment? Create an Alexa skill.

  • Nix and NixOS

    NixOS and the Nix package manager offer a promising new approach to the challenge of managing packages in Linux.

  • Deluxe Web Radio

    An LCD in an unusual format, a self-designed housing, and matching software make a simple Raspberry Pi web radio the perfect centerpiece for any living room.

  • Parsing man pages for modern users

    Explainshell aims to make documentation more accessible.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News