DEV Community

Discussion on: Reasons why Django is the best web framework

Collapse
 
skorrborg profile image
steve-orr

I have done a lot of Django and a lot of Flask. I was an early adopter of Django going back to shortly after its initial release... Then I found Flask which I strongly prefer. When I have a choice I use Flask. There's a reason that FastAPI was based on Flask then created it's own Flask-like framework.

Now some may say that an API-only solution is a special case to a web-dev framework. That is true, but there are oh so many such "special cases" that are better and more elegantly solved with frameworks where you get to make significant architectural/design decisions yourself. You don't have to just resort to or settle for the "Django monolith." (I was recently shocked when someone gave Django the dreaded "monolith" designation. True that.)

It must be conceded that Django is tightly wedded to SQL. As Joost mentioned, Django generates terrible queries. That being the case I believe it is incumbent on the professional developer to be thoroughly competent/expert in SQL. I confess my bias here as a former DBA. It should be second nature for us to write performant queries. SQLAlchemy is great but I rarely need it. Having to tune/monitor queries with SQLAlchemy is a pain. Sure, I can write custom queries for SQLAlchemy, but when I find myself constantly working-around SQLAlchemy in this way it begs the question, why use it? I have created a great many websites and webapps with Flask. There's nothing that Django does that can't be done better with Flask.

I know SQL. I know Python. I know HTML. I know CSS. I know JavaScript. I know templating. I know how to design and build systems without having to resort to a monolith. I have found that learning how to do these same things in Django takes more time than just doing it directly without Django. In this context Django much less intuitive. Besides, there are a great many 3rd party packages for Flask which you can plug-and-play and/or customize/tweak to just get stuff done. Finally, developers should be able to address performance beginning with the alpha release.

I want to be a DEveloper, not a DUHveloper.

The only reason that I continue to do Django is because of its widespread adoption. As a freelance contractor I'm a "technical whore" where I profess love to those who pay me well. :-)