Category: Programming

2014-09-28T01:32:37Z

The Flask Mega-Tutorial: Now with Python 3 Support

After more than a year working on various projects on the side of my day job, I have now found some time to rest and return to the blog, which I haven't cared for much during this time.

The number one problem I see from my readers is issues when trying to follow my Flask Mega-Tutorial using current versions of Flask, its extensions, or Python 3. In this article I quickly describe the updates I have made to the tutorial.

23 comments

2014-09-23T16:38:06Z

Using Flask-Babel with Flask 0.10

One of the interesting problems that I had to address when porting my Flask Mega-Tutorial to Flask 0.10 was in supporting Flask-Babel. There is an issue when a "lazy" text generated with the lazy_gettext function is flashed. This issue was reported more than a year ago and hasn't been addressed yet.

In this short post I will show you how I solved this issue for the Mega-Tutorial, as this solution is applicable to any Flask project.

10 comments

2014-04-21T07:00:03Z

Easy Web Scraping with Python

A little over a year ago I wrote an article on web scraping using Node.js. Today I'm revisiting the topic, but this time I'm going to use Python, so that the techniques offered by these two languages can be compared and contrasted.

60 comments

2013-12-24T01:26:25Z

Flask Book and PyCon Update

With my book already available for pre-order at Amazon.com I thought an update is in order.

21 comments

2013-11-28T07:33:19Z

RESTful Authentication with Flask

This article is the fourth in my series on RESTful APIs. Today I will be showing you a simple, yet secure way to protect a Flask based API with password or token based authentication.

207 comments

2013-11-05T07:03:42Z

Flask-PageDown: Markdown Editor Extension for Flask-WTF

(I can't help it. I keep coming up with ideas for cool Flask extensions.)

If you've asked or answered a question on Stack Overflow you have seen the editor that they use. You type your text using Markdown syntax in a standard text area HTML control and below it a preview is generated as you type. This editor is powered by an open source project called PageDown.

Today I'm introducing Flask-PageDown, a wrapper extension that makes it really easy to add this control to your Flask-WTF based forms.

38 comments

2013-10-24T06:49:48Z

Flask-Moment: Flask and Jinja2 Integration with moment.js

If you followed my Mega-Tutorial articles you may remember that I dedicated an entire article to the topic of rendering dates and times.

I needed to revisit this problem for my upcoming book, and this time I decided to package this functionality in an extension. That is how Flask-Moment was born.

21 comments

2013-10-01T05:45:43Z

How to build and run MJPG-Streamer on the Raspberry Pi

It's been a while since I wrote the article on streaming video from the Raspberry Pi using MJPG-Streamer. Since I published that article I have received several comments and questions regarding issues building MJPG-Streamer, so in this short post I'm giving you revised build instructions.

335 comments

2013-09-09T06:12:19Z

Flask-Migrate: Alembic database migration wrapper for Flask

In this post I introduce you to Flask-Migrate, a new database migration handler for Flask based on Alembic that I just made public.

124 comments

2013-09-01T23:37:05Z

The Package Dependency Blues

Today I'm going to tell you a story. This is a true story about a web developer that I will call Peter.

Peter is the author of a web application that I will call App. He wrote App in Python, using a relatively popular web framework and a handful of packages that extend the framework with additional features. The actual names of these packages aren't important to the story, so I will call the framework Foo, and one of its extensions Bar.

23 comments