News for hackers. Stuff that matters.
Re:The Flask Mega-Tutorial (2012) by diminoten on Monday November 19, 2018 @01:16AM (#18484513)
I've been using Flask for a few years now, and the other day had to whip up a small app for a task at work. This is the first app I've used Blueprints and Application Factories, so I'm looking forward to better understanding their payoff in the future.
Re:The Flask Mega-Tutorial (2012) by cirgue on Monday November 19, 2018 @09:09AM (#18486477)
Do you know of a good side-by-side comparison of a simple app built with blueprints versus one without? I am still trying to wrap my head around the problem that they solve.
Re:The Flask Mega-Tutorial (2012) by guitarbill on Monday November 19, 2018 @12:58PM (#18488255)
thing is, a simple app won't show you the benefits. blueprints are basically modules, and allow you to compose a big flask app from multiple blueprints. so as your app grows, you can add new features sanely (especially routing). a nice side-effect is having to think as features being correctly separated.

initially, it's only a bit more effort, but as you scale it'll stop e.g. your views.py getting out of control, without resorting to hackery.

again, it can be hard to do retro-actively, and once you realize you need it, the codebase is usually pretty bad. so i just do it from the start, as the extra effort is small then.

(best practices prevent team members with less experience from committing attrocities and give them a good foundation to copy from)