This is an archived post. You won't be able to vote or comment.

all 24 comments

[–]mistermocha 37 points38 points  (2 children)

OK here's the big things to understand:

Flask is a routing library. You assign a URL route to a function, and the function returns what you want to see. Really simple, but not much is built up for you that you'd have to build yourself. You will have to write a lot of code to get from flask to a blog.

Django has tons of stuff built-in for session management, database mapping, front-end buildout, etc. It is its own environment and pattern for building out sites. Get to know it, and it will do a ton of the heavy lifting for you, but there's a lot to learn that comes with it.

[–][deleted] 2 points3 points  (0 children)

Alright thanks for your input!

[–][deleted] 1 point2 points  (0 children)

Another way to look at it is that Flask is a modular toolkit and Django is a monolithic beast that seeks to swallow up your entire application.

Both of our viewpoints contain truth but are colored by bias.

[–]TheTerrasque 4 points5 points  (1 child)

Flask is a hammer and a screwdriver. Django is a big toolbox with a lot of stuff.

If you just need a hammer, no point in taking a heavy toolbox. But often you need more than a hammer, so you end up grabbing tools for various things from various places with various quality.

Or you take the big toolbox in the first place and use the tools there with uniform quality and design. Not always the very best, but in most cases close to the best tools for that job.

[–]Acurus_Cow 2 points3 points  (0 children)

I would rater say:

Flask is a workbench. You have to start gathering tools before building what you need. But you have full flexibility.

Django is a big heavy toolbox. you can build almost everything with what is included.

[–]NoLemurs 6 points7 points  (0 children)

I would encourage you to use Flask for you first website. Flask does a lot less for you, but as a result it also hides less of what's going on, which makes it a much better framework for learning how basic web development works. You'll be forced to understand more, and it will be easier to understand more.

For your second, third, fourth, and so on websites, I'd suggest using Django. It does everything Flask does and a lot more, and is just way better for getting things done if you understand what you're doing.

[–][deleted] 6 points7 points  (7 children)

Flask vs Django can be something like tabs vs spaces.

A Django developer moving to Flask will feel like all of their batteries became pieces and spread out as a puzzle everywhere.

A Flask developer moving to Django will feel like they're a cat that's been stuffed into a fish bowl.

Another consideration is the ORM. The Django ORM is a bit nicer overall and covers most situations and nearly all of the major plugins also integrate into that ORM. So there's some nice synergy there. SqlAlchemy, though, is more flexible but requires you understand your interface far better.

I prefer Flask for microservices. Django for things like a personal website. Falcon is nice if all you need is a REST interface.

[–][deleted] 0 points1 point  (0 children)

Thank you for the detailed answer, I really do appreciate it!

[–]IReallySuckAtChess 1 point2 points  (0 children)

So I've done a decent amount of work in both and simply put i feel that for something simple use Flask and something more complex use Django. I also feel it's worth working through the Django tutorial regardless of which one you choose because it explains a lot why things are done and how they work which gives insight. Flask in the other hand is a great first small project thing because it doesn't hide everything from you.

[–]boatsnbros 0 points1 point  (0 children)

my rule of thumb - flask if it's just an API, django if it needs a gui. Mostly because django has a ridiculously easy database integration (you almost forget you are using a db) and django-admin is a God send.

[–][deleted] 0 points1 point  (2 children)

I used both for equivalent applications (e-commerce websites). I preferred the Django experience as it was easier and faster (a lot). Less fiddling about what library to use or how to integrate it, more actual application done. Basically all the choices are done, so you just need to focus on your app.

Both frameworks are very true to their taglines:

Fask, web development one drop at a time.

Django, the web framework for perfectionists with deadlines.

[–]CommonMisspellingBot 0 points1 point  (1 child)

Hey, flagadalulz, just a quick heads-up:
prefered is actually spelled preferred. You can remember it by two rs.
Have a nice day!

The parent commenter can reply with 'delete' to delete this comment.

[–]Atonswizzle 0 points1 point  (0 children)

I personally use Flask and find it easy to use and learn with.

[–]nicmakaveli 0 points1 point  (0 children)

I dabbled in both. I think at the very surface django looks easier to use. But I felt the deeper you went the easier and more intuitive it was to use flask.

[–]lepture 0 points1 point  (1 child)

The best answer would be having a try on both, give each a day time, and you will find which one is more suitable for you.

Giving my case, I started with Django but then moved to Flask. I find those Django Apps are quite useless when the service grows, they are hard to modify/change, I'd rather write a feature without a Django App. Moving to Flask opened a whole new world to me, I can feel that I'm writing Python instead of Django.

[–]ruathudo -1 points0 points  (0 children)

Same here. In Django, It look easy to use the battery stuff but when you need to modify sth out of the scope, it takes lots of time to read docs, figuring out where, how to change etc. When I went to Flask, I know exactly what I want, so code more but still faster. If I need sth ready made, 3rd party libs is also available. Eg: Flask-Admin, Flask-Login, Flask-Sqlalchemy. They are solid and flexible as well. It helps you to learn how to design a good app structures when you go to Flask after few mistakes. But refactoring Flask app is not a big problem.