Tutorials

How To Install the Django Web Framework on Debian 8

Insight: Tutorial to install Django On Debian

In this tutorial we will show you the method to install the Django web framework on Debian 8. Django is a popular Python web framework for developing web applications. There are multiple way to install this framework.

Install Django On Debian

How To Install the Django Web Framework on Debian 8

Method 1: Install from packages

Before installing you need to update your local packages:

sudo apt-get update

Now install the python. Here we are installing python 3 with django:

sudo apt-get install python3-django

After installing, you can check it:

django-admin --version

Method 2: Install through pip.

Before jumping into the installation, we need to install pip package manager.

sudo apt-get update

We are installing python 3 with django so use the following  command.

sudo apt-get install python3-pip

Now install django using pip.

sudo pip3 install django

Now, you can verify the installation.

django-admin --version

You will see output something like this.

1.10.4

Method 3: Install Django on your system is with the virtualenv tool.
One of the advantage of using this method is that it will create virtual Python environments where you can install any Python packages and it won’t affecct your ubuntu working environment.
As usual.

sudo apt-get update
sudo pip3 install virtualenv

Command below will help you to create a project name.

mkdir ~/projectname
cd ~/projectname

Now create a virtual environment. Make sure you are creating virtual environment within the project direcotry. In command below, omgfoss is our virtual environment name.

virtualenv omgfoss

Now, we need to install package into our virutal environment.

cd ~/projectname
source omgfoss/bin/activate

This will install a standalone version of Python, as well as pip. Now, install Django using pip in your virtual environment.

(venv) pip install django

Method 4: Install Django through git ( Development Version)

In this method, we will install django through git. We are using python 3.

sudo apt-get update
sudo apt-get install git python3-pip

Now clone the django repo.

git clone git://github.com/django/django ~/django-dev

Now,install Django directly from the git directory with pip. ‘e’ means editable mode.

sudo pip3 install -e ~/django-dev

 

Subscribe To Our Newsletter.

Subscribe To Our Newsletter.

Join our mailing list to receive the latest linux tutorials, tips & tricks, freebies,news and updates from our team.

You have Successfully Subscribed!