Skip to Content
Get my Updated Resume

7 mins read


Django Introduction and Installation

In this article we'll look into what is Django and what are it's advantages or disadvantages and why should we bother trying it out.


What is Django?

Django is a Python-based Web Framework that allows you to quickly develop web-based applications without the dependencies and other stuff to be taken care of like the others.

When you are developing some sort of web applications then you will need some authentication ( Sign-up, Sign-in, Log-out ) an Admin Dashboard where you will do some admin activity. Django offers ready-made items that you can use.

So why should you choose Django as your Server Language ( Just because of some authentication and Admin Dashboard? )

Why Django?

  1. In the Django framework, It is very easy to switch between Databases.
  2. It has Admin Dashboard Pre-Developed
  3. It is a completely functional framework that requires nothing else to be installed
  4. It has several different packages available ( if required )
  5. It is highly scalable.

Django and its Popularity

Django is currently being used by many popular websites that are currently running live including Instagram, Mozilla, National Geographic, etc. According to the sources present over the Internet currently, there are nearly 5k online websites running on Django.

On Developer platforms like GitHub and Stack Overflow Django stays on the list with the position of 6th in the Top 10 web app frameworks.

Features Of Django

Django's Versatility

With the help of Django's versatility, we can Develop almost any kind of website over the internet. It can be used to develop server-side web apps or client-side web apps and can be used to deliver content in any format like HTML, JSON, XML, CSS, JavaScript, and other types of files. Mostly it is used to develop web apps like E-Commerce Web Apps or Blog Web Apps.

As so I have Developed an E-Commerce web app with Django with a client-side web app enabled you can visit RushX from https://rushx.pythonanywhere.com and soon I will deploy a Complete Blog web App named as Down the Code

Security

Django was developed with Developers who have a good experience so they developed Django in such a manner that it made Web Development a lot easier than it was ever thought of. As it was made to make web development easier so by default it was made to apply the settings and things that automatically do the right things to protect the website from harmful threats.

Scalability

Django web framework is highly scalable as it doesn't store any information statically just hit the URL and you will get the Data dynamically generated through Django.

Instagram and Disqus are the two of examples what can a Django web framework serve to a user and with such a high performance.

Portability

As we all know that Django is a Python-based web framework that means that all of the code-bases are written in Python language, that's the reason that it can be run on different platforms like Linux, Windows, and OSX.

Installation of Django

For installing Django you first have to install Python as Django is a Python-based web App framework so as a Dependency you must have Python Installed from Official Python website and follow the steps instructed there depending upon your operating system.

So assuming that you have installed Python on your System now we should now proceed without Django Installation.

Step 1

Fire up the Terminal or Power Shell ( If you are on Windows ).

Step 2

Hit this Command in the Terminal or Power Shell

pip and hit Enter

Step 3

If there is no Error displayed then you are ready to go further else you shall Google your Error displayed onto the Console.

Step 4

Now if there is no Error displayed onto the console then hit this command

pip install django

Our Very First Django Project

For developing our very first Django Project you shall hit some of the commands in the console ( either Terminal or Power Shell ).

Step 1

Hit this command in your console Django-admin start project firstProject

Now after this command your new project will be created with the project structure given below:

└── firstProject
    ├── firstProject
    │   ├── __init__.py
    │   ├── asgi.py
    │   ├── settings.py
    │   ├── urls.py
    │   └── wsgi.py
    └── manage.py

Right now don't think of the files we will have a deep discussion on them later on in a dedicated article. Right now we aim to develop a bare minimum web App with Django.

Step 2

In the same terminal or Power Shell type this command

python manage.py runserver

Now, this will give you a bunch of different things and setting related to it but you all have to do is ignore this and on successful execution of this command open up your browser and navigate to the web address instructed on the console.

127.0.0.1:8000

When you will hit that address then you will get a successful message that you have successfully installed the Django web framework on your System and now you are ready to make your Application as you want.

Now on successful installation take a break from it and refresh your Python skills as from now on we will be discussing Django in more python related syntax.

Step 3

Hit Control + C to stop the development server ( In Windows and Linux ) and for OSX ( I think Command + C will be equivalent )

Benefits of Django and its built architecture ( MVC Architecture )

  • Rapid Development
  • Loosely Coupled
  • Ease of Modifications

Drawbacks of Django's Architecture ( MVC Architecture )

  • Too much load on the Model Component
  • Development Complexity is High
  • Two Components are controlling view

Conclusion

Django is a very popular and powerful Python based Web Framework which is highly scalable and is very secure and is available with some ready-made components like Admin Dashboard and User Authentication and much more packages if required.

Django can be integrated with front-end frameworks like React, Angular, Vue JS using Django Rest Framework ( DRF ) and also Django can work with HTML, CSS and JavaScript to display a most Interactive UI with most security also with best practices with scalability and flexible Data Base.

Future Updates

In the next article I'll try to explain Django in a more consised and step by step with a bit of hands on practice by developing a Weather App along side to show you all the steps to get started developing Django Apps.

Promotion

Be sure to Subscribe to the newsletter on either of my websites ( that's the platform you're reding on and Code It Down ) and to get in contact use this form ( I made it and hosted it for free so that's the reason I've to made a special promotion to this do ignore if you want to XD ).