3 ms·
On Flask vs Django: > Flask is a “microframework” for Python, and is an excellent choice for building smaller applications, APIs, and web services. > Flask is
by eevilspock 10y ago
On Flask vs Django:
> Flask is a “microframework” for Python, and is an excellent choice for building smaller applications, APIs, and web services.
> Flask is default choice for any Python web application that isn’t a good fit for Django.
Not very helpful. What is the threshold between "smaller" and larger applications? What makes an app not "a good fit for Django"? I've never found clear answers to these questions, mostly just vague opinion. This Hitchhiker's Guide, a self-proclaimed opinionated guide, could really take off if it got some opinion and backed it up with real rationale.
- yeukhon 10y agoI for one think Pyramid should be recommended over Flask. I would choose Pyramid over Django if I want to customize and do everything myself. Whereas if I want a very active and very mature community of plugins, I would stick with Django. When it comes to a secure framework out of the box, Django is definitely the winner out of all Python web framework.
- ianamartin 10y agoInteresting take on this. And I respectfully disagree. I would use Pyramid over Django any day of the week, and Flask for anything smaller. My reasoning is that any project that needs as much as Django has built-in is going to need the custom work you put into a Pyramid project anyway, so you might as well start off there and use a nicer API from the get-go. Anything less is Flask territory from my point of view.
- gshulegaard 10y agoAnother interesting point of view. So I thought I would throw in my two cents on this. I started web development using Django, then tried Pyramid, and finally moved on to Flask. And since picking up Flask, I haven't gone back...and I wouldn't go back to "heavier" frameworks...although I have considered taking a peak at a couple other micro-frameworks. I have a couple strong (personal) reasons for this (read: YMMV), but the biggest thing for me is I see web development moving towards a strict separation between front-end and back-end (SPA's, web assembly, microservices, etc.) as well as multi-model/multi-storage. Neither of which lend itself well to all-inclusive framework solutions IMO. At the end of the day I guess the take away is to remember that it's great to have so many strong frameworks each with its own strengths to choose from in the Python ecosystem.
- aangjie 10y agoMy experience says, flask is a better choice, if you anticipate lots of changes in tech needs(like, async webservers, heavy UX customization in workflow etc....) then flask (or other micro web-frameworks) are useful. If not you can go with django and build the rest around it. However, django over the recent years have been making an effort to make their stuff more plug-and-play style..
- johnwheeler 10y agothe way i've always looked at it is that django was python's answer to RoR, and it was great at the time, but it doesn't embrace decorators or context locals--two things which make the flask API beautiful. and, when you compare sqlalchemy to django's ORM -- Sqlalchemy is more powerful. i can't give specific reasons why. I think zzzeek is just insanely focused and that beat out design by committee. (mitsuhiko too incidentally). maybe that's wrong, just my intuition. sqlalchemy is probably the best orm in _any_ language. there's a huge django community that would disagree, but you don't see concrete reasons why django is better than flask, but flask is better than django for the simple reasons i mention. they're not different meant for large and small apps. everything django can do flask can do better, cleaner, simpler.
- xorcist 10y ago> django was python's answer to RoR, More like children of the same era. Django is older.
- RubyPinch 10y agoif its a pile of function calls, and you feel that walls between the database and code would be a pain, then probably flask. Its good for taking something and throwing a UI on it If you think "golly gosh, maybe some abstraction between the database and the code, hell, maybe even one of those wonderful Model View Controller things, whatever they are, would be great fun" then probably go for django or any other MVC framework Flask can do all that, but it requires your help to achieve it. You get control over what ties with what. Django is already set up for usage, just put your code in one of three boxes, and done, but you can't decide what those boxes are or how to use them. It brings a standard structure but you lose control.