Saturday 1:40 p.m.–2:25 p.m.

Writing RESTful web services with Flask

Miguel Grinberg

Audience level:
Web Frameworks


Flask is a web framework for Python based on Werkzeug, Jinja 2 and good intentions. It is considered a micro-framework, but don't get the "micro" part fool you; Flask can do everything the "others" can do, many times in a simpler, leaner way. This session will introduce you to Flask as an engine to build RESTful web services.


In recent years the Representational State Transfer (REST) architecture has emerged as the predominant design style for web based services. In this session you will learn about RESTful web services and how they can be implemented using the Flask microframework. **Why REST?** Because REST is simple and lightweight. And because the most popular implementation of the REST design is no other than HTTP, the protocol that powers the World Wide Web. Clients and servers of RESTful web services implemented on top of HTTP can take advantage of the huge existing infrastructure that powers the web. In this session you will see how easy it is to implement a web service on a general purpose web framework. **Why Flask?** Flask is a small, easy to use, yet fully featured open source web microframework written in Python. Its code is concise and well written, you can read it all and understand it. As you will see in the demonstration part of the session, the straightforward way in which responses to web requests are written in Flask enables developers to create easy to maintain implementations of RESTful web services.