DEV Community

Cover image for Reasons why Django is the best web framework

Reasons why Django is the best web framework

Nishant Mittal on June 16, 2021

Choosing a web framework is hard especially now when there are a lot of frameworks on the market, each designed to address different project needs....
Collapse
 
ericlecodeur profile image
Eric Le Codeur

I use both Django and Laravel. I love Django because it's easy to get going and use Python. But framework vs framework Laravel is superior is every way. For example, to bring a Django web app to production you will have to write a lot of boiler plate/config code. In Laravel your app is production ready day 1. Laravel package are develop and adapt to fit perfectly with Laravel. In Django many times you have to use a python package and make it fit to Django (with almost no documentation and you have to write boiler plate/config code).

Collapse
 
jhelberg profile image
Joost Helberg

I left django after a while as it is doing too much, some of it in the wrong way. The ORM will generatie terrible queries, so you end up writing all of them yourself, also database models never fit use-cases, so ORM's are almost always another level of no-abstraction. Role-management goes on top of the RDBMS roles, which is doing things twice and probably less well than your RDBMS. Forms and templates are OK though, but not worth the effort of going through python-pain. The best feature is that it will adapt to an existing database, greenfields are an exception and django is good in adapting to existing stuff. The migration features are useful only if django is the only way to access data. It never is, so migration normally is addressed at the database level with backwards compatibility.

Collapse
 
skorrborg profile image
steve-orr

Yes Joost, you're absolutely right. I found myself having to work-around the opinionated-batteries-included framework several times because it either didn't do what I needed or did it in a clumsy time consuming way to implement. I was fundamentally appalled at the crazy queries it generates.

Collapse
 
martinhaeusler profile image
Martin Häusler

The features of the frameworks don't matter when the language itself isn't strongly typed and compile-time checked... There are some ongoing efforts in that direction in Python, but I'm afraid it's too little, too late. For me, that disqualifies Python for any serious project.

Collapse
 
kateryna_pakhomova profile image
Kateryna Pakhomova

Django is one of those software development technologies that have the greatest potential in the industry.

We are very much into researching this topic, and want to present to you an overview of this framework, its benefits, and potential implementations.

Make sure to check it out:
softformance.com/blog/why-django-f....

We’re sure that it will provide you and your readers with tons of practical information and examples of successful Django implementation.

Don’t hesitate to use our link for a deeper insight into the topic!

Collapse
 
rafaacioly profile image
Rafael Acioly

I really like Django but I think that we can't compare with Laravel, laravel ecosystem, features, and documentation are the best out there.

Collapse
 
nishantwrp profile image
Nishant Mittal

I don't think it has the same amount of batteries included. Plus I personally feel that Python outperforms PHP in terms of the amount of third-party packages, learning, etc.

Collapse
 
dollardhingra profile image
Dollar Dhingra

Yes, laravel has a great ecosystem and documentation. In terms of performance, however, Laravel doesn’t compare to Django, which might be a drawback for massive projects

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. :-)

Collapse
 
yuhuishishishi profile image
I love integers

It is really friendly to use to bootstrap your ideas. This is quite important at the early days of your startup.
Personally I am not worried about its query optimization or performance since you probably never get a chance to think about it before you bring your company out of survival mode.

On the other side, the features provided - ORM, authentication, admin, rest-framework ... these help a company with a limited handful of engineers a lot.

Collapse
 
aspraveen profile image
praveen

I too use both django and laravel.. both are great frame works..

Collapse
 
calag4n profile image
calag4n

Django is great as long as you work with SQL database.
It comes very tricky with NoSQL DBs and it can't really use the power and the ease of embedded objects.