Re:Ask HN: Django or Flask as first web framework?
by veeti on Friday October 19, 2012 @05:54PM
(#4675543)
I agree completely. However, personally I am using Flask only because tacking SQLAlchemy on top of Django feels so hacky. I wish there was a second full stack framework with SA.
Re:Ask HN: Django or Flask as first web framework?
by GeneralMaximus on Saturday October 20, 2012 @12:03AM
(#4676329)
Have you given Pyramid a look?
The assertion that Flask gives you a better look under the hood is, in my opinion, incorrect. With Flask, you get almost nothing out of the box besides some basic URL routing and request handing. For most web development tasks, that's not enough. So you end up adding an ORM, a template engine, a session handling library, etc. on top. Eventually you end up with a set of libraries that have as much "magic" to them as your standard Django install, except now they're loosely held together by duct tape. Just take a look at SQLAlchemy, WTForms or Jinja2 -- three libraries that are often used with Flask -- and tell me whether they feel less like magic than Django's equivalents. Plus, now you have to look up documentation for three libraries in three different places, keep up with their developments separately, and get used to three different coding conventions. It gets complex very fast.
As adambard mentioned, Flask is a very effective tool when you want to do something highly nonstandard and rolling your own framework is your only option. For 9 out of 10 webapps, though, Django is the right answer.