Why Django?

Why Django?

There are various backend frameworks one can choose from, each with its unique advantages, disadvantages and optimal use cases. they could range from laravel with php, to ruby on rails, to express js used with node js (which is increasingly popular in the tech community).

But I chose Django.

Why?, you may ask.

that is what I hope to cover in this article, so sit back, relax and enjoy this Django ad.(jk I wish I was actually affiliated to Django)

first off.

What is Django?

nope, not the movie.

Django (in software development) is a Python-based free and open-source web framework that follows the model–template–views architectural pattern.

Django was invented to meet fast-moving newsroom deadlines, while satisfying the tough requirements of experienced web developers.

Marketed as "The web framework for perfectionists with deadlines", its a high-level Python web framework that encourages rapid development and clean, pragmatic design.

High-level you say?

Yes, high level.

This simply means Django gives you a very specific way of doing things. you have to structure whatever you're building according to the frame Django has given , so to speak. It comes with a lot (and I mean a lot) of baked-in tools and features.

Its also referred to as a "batteries included" framework, which just means it comes LOADED with most of what you need to "power" your project.

This gives less room for error and since you're following specific guidelines on how to structure your code, the chances of you "messing up" are reduced.

Keeping this in mind you can understand why it has these 3 core features :

1. Ridiculously fast:

(in development time).

Django was designed to help developers take applications from concept to completion as quickly as possible. Remember i said Django comes with a lot of prebuilt features? no kidding. There's probably no feature that hasn't been taken into account by Django to some degree. it comes loaded to take the stress out of development by taking care of a lot of tasks, so you wouldn't need to write code for them. this drastically cuts down development time compared to how much time spent building the exact same features with some other framework. imagine something that would take you a month in laravel or node taking half a month or less in Django? yeah, that kinda speed. it gets you to your destination faster as a developer.

2. Reassuringly secure.

Django takes security seriously and helps developers avoid many common security mistakes. Again, due to the predefined structure it provides you with, most mistakes can be avoided especially regarding security. Django of course took this into account and as a result provides inbuilt features that negate common cyber attacks E.G CSRF, clickjacking, sql injection, XSS, etc. when I say Django's got you covered, I mean its got you COVERED. you will further implement security features to secure your project, that's for sure, but you wont be building it all from scratch.

3. Exceedingly scalable.

Some of the busiest sites on the planet use Django’s ability to quickly and flexibly scale to meet the heaviest traffic demands. You can definitely see why its ranked the second most popular backend framework in the world as of march 2021.

Screenshot (188).png just to mention some sites that run on Django:

1. Instagram

- with over 1bn users, instagram is one of the biggest social networks on the planet, processing more than 95m photos uploaded daily. who's handling all that?

2. youtube

  • boasting of 2bn+ users, youtube is by far the largest video hosting platform in the world. estimatedly 500 hours of video uploaded to YouTube every minute worldwide. who's handling all that?

3. Dropbox

Dropbox has 700m+ users, with 1bn+ files uploaded per day. who's handling all that?

4. Pinterest

  • With 454m+ users, Pinterest is a site for creating collections of collections, what would be a more befitting use of the Django framework?

As you can see, this framework is tested and trusted even by the big players. scaling to even billions of users, Django can handle the heat(or weight?).

And these are just general reasons why its so awesome.

In addition to the above personally, I like Django because :

4. Its Python based.

If you know me, you know I love python(as opposed to javascript). And this further translates to why I enjoy using Django. it inherits Python's simplistic syntax and is fairly easy to pick up. The fact that python is a general purpose language used in other fields such as data science and machine learning makes it a good investment not only for web development. so say you want to switch to some other field in the future? you don't have to go through the stress of learning an entirely new language.

5. Its Flexibility.

(relatively.) okay hear me out.

Unlike some frameworks...( Ruby on Rails), Django doesn’t follow the convention over configuration mechanism. Since it is written in Python, a versatile programming language, Django for web development provides more flexibility and dynamism to the developers. you can configure the framework according to your needs and it provides excellent support for external packages and libraries.

Given all these features, Django is pretty awesome yeah?

So why isn't it the most used framework if its that great?

If it comes with so many features out the box, doesn't that save devs so much time and energy?

who likes stress?

As with most things Django also has its drawbacks.

Pitfalls

Turns out Django's not the perfect framework.(then again, which is?)

Some of Django's cons include:

Monolithic framework

Django programmers consider the framework as a single package, which is not a good thing. The lower dependencies Django have, the more code, developers will have to write.

Multiple request issue

Django is different from most frameworks, but sometimes it is also a disadvantage. Unlike most web development frameworks, Django can’t handle multiple requests simultaneously.

Quite frankly, Django is slow :(

Here's an image of the web app performance of different web frameworks

image.png

you can obviously see the Gap between Django and other frameworks. this is expected as coming prebuilt with all these features definitely has to come with some effects.

But I still choose Django

Why?

Maybe I'm a python lover boy.

Maybe I just appreciate the simplicity of the framework.

Maybe I don't want to go through the stress of building everything from scratch :)

Despite its cons it still manages to be the second most used framework so hey! its gotta be doing something right!

like all frameworks, Django has its optimal use cases, its Pros and Cons, all of which appeal to me in unique ways and are definitely worth trying out !