O'Reilly logo

Learning Python Design Patterns by Gennadiy Zlobin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementation in Python

For a practical example, we'll create a very simple but working URL shortening service with a Flask micro framework that is developed by Pocoo.

Flask is a micro framework that is intended to create simple and short applications. It provides API for handling typical web-development tasks. On the other hand, it does not have object-relational mapping, form validations, and other features typical to bigger frameworks such as Django or Pyramid. Flask is very expansible with third-party libraries and modules. It does not use MVC out of the box, but let's us take advantage of its high customization and allows us to use the MVC pattern in Flask.

First, you should have Flask installed. Any one of the following commands should be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required