What makes Django cool?

Shankar Jha
7 min readOct 25, 2019

--

In this tutorial, we will look into some of the cool features provided by Django. By the end of this tutorial, you will start using Django :)

What is the Framework?

In simpler words, Framework helps you serve the request-response cycle in an effective way, and this is where Django comes in the picture. Here is the picture below on how Django handles the request-response cycle.

Request-Response Cycle in Django

Check out this Reddit thread to know more about the request-response cycle:

What is Django?

Django is an open-source framework for creating a web application using Python programming. Its main goals are flexibility, simplicity and reliability. Here is the tagline of Django which says everything

The web framework for perfectionists with deadlines.

Let’s dive into cool feature provided by Django:

Python

Django is written in Python which is one of the most popular programming languages in the world. Python is easy to learn and this is why people started using Django for web development. If you are a Python developer and haven’t started using Django, you must try it once.

I have also written an article on python which got published on pythonbytes and hackernoon.

Batteries Included

Django has a lot of inbuilt packages which are ready for you to use without even writing a single line of code. Django batteries are located in contrib packages. Here are few of the packages which are worth mentioning

Admin: Django administration application

Auth: Django Authentication Framework

Session: Session management

Message: Manage cookies and session

Gis: Provide Geographical location

Postgres: Postgres Database

You can imagine, if you have to write all this by yourself, then how much time it will take to code to make it perfect. Now you have a fair amount of idea about why Django is called battery included and how to switch it on.

If you want to learn more about the inbuilt packages, check out this link:

Built-in admin

Django comes with a built-in admin dashboard which is one of the killer features of Django. This takes a lot of time if you have to create from scratch and this is where Django rocks!!!!!

You can easily customize the admin panel according to your need and this is the reason why Django is flexible for developers.

It looks something like this by default

If you want to learn more about the admin, check out this free book

Documentation and Tutorials

As a Developer, we rely heavily on official documentation and Django has great documentation for us. Django documentation has all the details you need to know about Django. This is one-stop-shop for all your questions related to this framework. It’s written in a clear and concise way. You can check out here:

If you a beginner, here are few of the websites for you to get started with Django:

4. RestAPI

RestAPI is the defacto standard for an API and every company is adopting it. Django has a lot of third party packages which is available for you to use without writing a single line of code. DRF (Django Rest Framework) is one of the most popular third-party packages for Django which will let you convert your website into an API.

Here you will find all the Django third-party packages:

Check out this documentation on DRF:

Security

This is one of the most important concerns for any organization and Django got it covered for you. Django can handle a lot of vulnerability and help you make your app OWASP compliance.

Check out this talk to learn more about the security in Django:

Jupyter Notebook

If you like working with Jupyter Notebook, you can add it in your project and start manipulating your database in Jupyter notebook which is cool.

Check out this link to integrate into your application:

Front End Framework

One of the most important thing for any organization is to make their UI look simpler and elegant. You can combine Django with any of the popular front end frameworks like React or Vue. One approach is to create a RestAPI and let your frontend framework consume that API. You can create RestAPI using DRF.

Here are a few of the tutorials for you to get started with:

Unix Philosophy

Do one thing and do it well.

Django design pattern heavily relies on this philosophy and urge you to follow it. You can create your application which will do only one thing and thus will make your app reusable for others to use.

This is a must-watch talk by James Bennett, one of the core contributor of Django

Testing

Django comes with an inbuilt testing tool for you, which will let you test your application. You don’t have to learn any other tool but if you want to integrate Pytest or any other unit testing tools, Django will provide you with the option to do it.

Check out this link to know more about the testing in Django:

Scalability

Django can be easily scalable up to a million users and it has already proven by these Giant companies, so we don’t have to worry about this.

Instagram, Pinterest, EDX, Nasa and many more.

Here is the video about how Instagram is using Django to serve millions of users:

Here is the video about how Edx is solving million users problem

Django ORM

Django has its own ORM which lets you convert your Python object into a database model. You don’t have to learn anything else like SqlAlchemy.

Although, there is a lot of debate on choosing the ORM in Django. Stick to the default if you don’t have any solid reason.

Rich Community and Support

Django is Open Source and always welcome newcomers to join the community for any kind of help and support. Here are the few of the websites where you can ask your questions

If you are a python developer and haven’t tried Django, then I encourage you to check it. Django is a mature framework and it’s worth a try for you or for your company. You will learn a lot of things about Web development and Python best practices. You can follow me to learn more about Django and Python. I will be writing a lot of articles on Django and Python best practices.

That’s all about Django from my side. If you have any doubt or you want to add something, please comment below.

--

--

Shankar Jha

Shankar Jha is an experienced principal data engineer with over 6+ years of expertise in backend development, data engineering and technical writing