DEV Community

Discussion on: Django or Flask

Collapse
 
radorado profile image
Radoslav Georgiev

Both Django & Flask are great and both can do the job for you.

From my experience, I've found that:

  • If you start adding some abstraction in Flask for the common tasks & things, that you do in almost every web app, you are going to end up with Django
  • If you start removing a lot of the features in Django, you are going to end up with Flask

Flask is minimalist framework & Django is not a "fat framework".

For me, learning Django has long term benefits, because the abstraction is great & the libraries for things like "Rest APIs" are also great. It's more suitable for large projects that will scale with time.

On the other hand, I find Flask to be the right tool when I want to expose some kind of Python on the web (with AWS Lambda for example). Then the 1 file approach works great for me.

And if you like the minimalist approach & you like building your own abstraction & using different tools for the job, Flask will be just as great as Django, but perhaps it's going to require more time & investment on your side.

And on the high level, for me, that's pretty much it 👍

Collapse
 
emmanuelobo profile image
Emmanuel Obogbaimhe

That pretty much answers it. I always knew that Flask was he lightweight framework while Django was batteries included but that was very detailed. Thanks.