Flask v. Django

This is a lightning talk I gave a couple months ago  at a PyLadies SF meetup.

TL;DR: Both are great tools. Django is better for fast and Flask is better for flexible.

I have to admit, I've never used Django in production, but I have used it for some test projects and loved it. When I first met Flask, I was confused about why anybody liked it. You'll see it in the slides, but a working Flask app can be just SEVEN LINES OF CODE. No plugins, no database, no nothing. (OK, that's a lie. You get Jinja templates.) Everything else you have to build or bolt on.

I've used it for about six months now, and I love it. There's a lot of elbow room with Flask - you can build your app however you like and it can grow organically. Flask gives you the tools and lets you knock yourself out.

To use a database with Flask, generally you use SQLAlchemy which IMHO is both the biggest strength and the biggest liability of Flask. SQLAlchemy does more than the Django ORM. It's fantastic, full-featured, well-documented...aaaaand it has a learning curve like Half Dome. The left side.

It's not easy to get started if you're a beginner. Flask also has the problem/benefit of being under rapid development - there are more plugins written every day. (Literally. I wrote a mail plugin just to discover somebody published one two weeks after I finished mine.)

However, if you have a group of strong coders, you can make Flask do magic. It's quick and agile once you get a handle on it.

In the end, I think both tools are awesome. Are you a beginner, writing a standard website, or need to code fast? Django's your pal. Want flexibility, freedom and room to grow? Flask is pretty awesome too.

Contents © 2013 Rachel Sanders