The real value of Flask is that it makes you appreciate what Django does by default.
When I first started learning Python / web frameworks, I went with Flask because it was smaller and "simpler". As my project grew however, I had to organize it. I was basically imitating what Django gives you by default, though less cleanly.
Those aren’t Flask components. They just work well with Flask. And Jinja, SQLAlchemy, and Alembic just happen to be the largest and best of them.
Many of these independent components pale in comparison to their Django counterparts in glaring ways—they are often a pain to use, with some pretty questionable internal code choices. They remain used because they are often the only choice out there, even though their implementations are inferior to Django’s.
I say this as someone who has used Flask for over 5 years, as well as nearly 5 years of Django.
I totally agree on SQLAlchemy. It’s very good. As is Alembic.
I feel like most using Flask would consider “Flask components” to be equivalent to Flask extensions—e.g., Flask-SQLAlchemy vs SQLAlchemy proper. Maybe it’s a pedantic nitpick, but I’ve never heard anyone refer to SQLAlchemy as a Flask component in 5+ years, hence my comment about the distinction. But yes, many of the Flask-compatible Python packages you mentioned are quite a joy to use.
this only applies if your project can be organised within Django's requirements though right? I use Flask and Django a bit but it usually depends on how "cookie cutter" the project scope is
That is a fair point. Since I was doing something kind of CMS focused, Django fit the bill. I suppose if you were doing something orthogonal to that, it would be better to have the flexibility of Flask.
Especially when you then go to maintain a Flask project where they have re-implemented Django, except you don't know where anything is or how it works.
Exactly. I have used Django quite a bit over the years and have maintained a few prebuilt (by previous developers) Flask apps for clients. Recently I had a need for a small web service so I thought I'd use Flask. After days of trying to get something simple running and installing numerous packages, I gave up on Flask. I had a server with everything I needed in less than a day with Django.
Some of the design decisions of Flask just don't seem logical, such as using the db instance when defining model parent classes. Makes for strange contortions when defining multiple model files to prevent circular references or db not found errors.
Can you elaborate? In all the dozens of Django projects I've worked with, I've never felt like Django got in the way, mainly because everything is pluggable and you can just not use it if you don't want to.
i learned to program with python and flask and promptly started hammering out my project. flask was great for learning piece by piece what goes into a web app but eventually it grew to a point where i was relying on all these extensions that were no longer maintained and i was spending alot of time to configure and setup every last bit of functionality i needed and every extension was like a new DSL to learn.
The obvious move at the time was to move to django and I spent some time familiarizing myself with it's own DSL. But boy was i struggling all along the way to do things how I liked in Flask with django. The Django Templates were extremely limiting (no modules) and couldn't even do regular python things and I came to find that extensions for Django were in no better shape than flask's. There was no clear solution for rate limiting and various other things I was looking for.
I've followed rails from a distance for a long time but, coming from python, ruby seemed so abstract to me i could just never figure it out but towards the end of my django time, i was finding that rails did/had everything i wanted and it all worked just the way i wanted it to and it was calling to me really hard. i took a big leap and spent a couple months diving fully into ruby, doing all the tutorials, reading all the books. at this point i am officially converted and my project app with it is already further along than i ever got with flask or django. when they say "ruby/rails is built for programmer happiness", they really mean it. and i can really feel/appreciate it. it's extremely fun to use and to see real progress without having to rack my brain and figure out some internals before i can proceed every so many hours. i'm just getting shit done and things work just how you'd intuitively think they should. rails ftw
When I first started learning Python / web frameworks, I went with Flask because it was smaller and "simpler". As my project grew however, I had to organize it. I was basically imitating what Django gives you by default, though less cleanly.