Tom Harrison
1 min readJan 26, 2024

--

Super-helpful article -- thank you. I come to Django by way of Rails (with an attempt at Flask in the middle). Rails has all of these goodies too, but as I am learning, it's really nice to have a simple set of examples called out. The N+1 queries issue gets even experienced developers, and Django makes it crazy simple. Thanks for the AJAX CSRF example -- was one of the items on my list.

As an aside, I started what seemed like a simple API framework app, so chose Flask. I guess Flask is pretty good for some use-cases, but for me it felt like even for the most basic stuff I was trying to figure out the best pattern to integrate each of the plugins needed, and building a whole bunch of code just to keep it all DRY. Nearly every bit you mention here is essential to every app, and a few more to boot.

For example, I tried to figure out the best way to create a simple seed dataset in Flask, and found a few plugins, but none really worked as I wanted, so I built a wrapper just to load JSON, and started adding to the Flask CLI. Then I said "Hey, I should look at Django" and in a few days had completely ported the app over, removing tons of hand-crafted code I had written (poorly). Django just works, and it presents a clean and evident structure that's well documented. And as it happens, the ability to generate and load seed data: built in. Sweet!

--

--

Tom Harrison

30 Years of Developing Software, 20 Years of Being a Parent, 10 Years of Being Old. (Effective: 2020)