Web development is one of the rapidly growing professions of this era. There are many good programming languages available to create some great web applications. I have found Python one of the best among them. However, there are various frameworks available to start web development with Python. Django seems to be the most popular and widely used in large-scale websites. In this post, we will learn about web development with Django Python.
Django is a lightweight open source Python web framework. First of all, it was developed to make the development easier for large-scale websites. It was released in 2005 and doesn’t gain much popularity at that period. However, the developers didn’t lose hope and they started to update it regularly.
Finally, they have succeeded with what they want. Now Django is one of the most popular web development frameworks of this era.
It has a lot of great features like ORM(Object Relational Mapping), MTV(Model Template View) architecture, ease of scaling and much more. In addition to all its much secure and better suited for rapid development.
So that’s a brief description of Django, now let’s see if its an ideal choice for web development.
Web development with Django Python
I have created a list of terms to verify whether we should choose Django or not. So let’s check each of them one by one.
First of all, before we start to learn something new we must have to make sure its worth it. As it will take time and much patience to learn something new. Popularity plays a vital role in terms of our selection. The more popular the framework is the more spread developers community it will have. So let’s check out how popular Django is.
GitHub is one of the best places to check out the popularity of a framework or the project. So let’s start with GitHub first.
As you can see Django is quite popular among web developers. It has more than 29k start and 12k forks. So you can imagine how strong and widely spread community it has.
Now we can’t only define its popularity based on GitHub only. So let’s see the usage statistics of Django and make sure it’s really popular.
As you can see from the above chart and details. More than 9k websites are using Django. It’s really smaller as compared to top PHP or Node frameworks. Anyway, don’t worry about the numbers because we have a list of most popular sites made with Django.
Instagram, Pinterest, Quora are on the top of the list. We all are familiar with these 3 sites. Django is used as the base in these 3 huge scale web applications.
So the above data proves that Django is quite popular and great for large scale web applications. Now let’s see how is the job market.
As you can see from the above image there are 256 active jobs available right now at Upwork. It’s really awesome that you can have that many jobs at a single site. Now let’s check out how many jobs are available at Freelancer.
That’s also great to see that Freelancer also has 179 active jobs available. Hence we can see Django has a good job market. So with proper knowledge of Django Python, you will never have to worry about jobs.
Get started with Django
Until now we have seen some great reasons to choose Django. Therefore it’s an ideal choice to choose Django if you are a python developer. Now let’s see how to get started with Django.
There are many different versions of Django available. They update versions regularly with minor fixes. So before you start to learn Django follow the image below.
So according to the above image 1.11.7 will be the best to choose now. As you will get support until 2020. Don’t worry because all the versions just have some minor changes. So it will not be much tough to change your project codes to an updated version.
I am assuming you a Python developer and pip is already installed on your machine. So just open the terminal and run the following command. It will automatically download and install the specified Django version.
pip install Django==1.11.7
Django 1.11.7 is the last version to support Python 2.7. So no matter whether you are using python version 2 or 3 it will work with both. I would suggest using Python 3 as its the future of Python.
Anyway, the above command will download the Django 1.11.7. So now to start a new project go to your desired directory and run the command below.
django-admin startproject project_name
It will create the project_name folder and it will add necessary files inside of it. So that’s our root project. We can create as many apps we want inside of our main project with the command below.
python manage.py startapp app_name
The above command will create an app app_name inside of our project_name directory.
As its just a brief article on Django so I am not explaining further. You can follow the Django docs for your specific version.
First of all, the official documentation of Django is the best one. As it provides in details explanation on each topic. However, newbies may find it difficult as it’s not neatly organized. So I would suggest following the given 2 books with the official documentation to strengthen your Django Python skills.
Two scoops of Django 1.11
It’s one of the best Django books I have ever found. This 556 pages long has everything you need to know about Django and it’s neatly organized. From debugging to creating REST API’s you can learn everything from this book. On the other side, its published recently and based on the Django version 1.11.
So what are you waiting for grab this one from Amazon?
Two scoops of Django 1.11
Django by example
If you are new to web development then this one is for you. It’s not only about learning Django. You can learn Django with various real-world examples like a blog, e-commerce etc. So this book will not only develop your Django skills it will also help you to explore the model behind popular web applications.
However, this one published in 2015 so it’s not based on the current Django version. But don’t worry there are not many changes. So you can definitely follow this one along with Django documentation.
Finally, we have come to end of our brief article on Django Python. Hope you have liked this one. So hurry up and grab a book from the above two and start with Django Python.