How to Install Django in Linux via Command Line

Posted on

This is an article discussing on how to install Django web-based framework in Linux operating system distribution via command line or using a command executed in a text or text-based command line interface.  The following are steps taken in order to install django :

1. In order for django to be installed in the machine, first of all python is needed to be installed. Check first whether python has been installed. In the context of this article, since the checking process is performed in Ubuntu Linux distribution, the ‘apt’ package management utility which can be used to achieve it. Below is the command to accomplish it :

apt list --installed | grep python

The output of the above command is shown as follows :

root@hostname:~# apt list --installed | grep python

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

dh-python/now 2.20151103ubuntu1.1 all [installed,local]
libpeas-1.0-0-python3loader/xenial,xenial,now 1.16.0-1ubuntu2 amd64 [installed,automatic]
libpython-all-dev/xenial,xenial,now 2.7.11-1 amd64 [installed,automatic]
libpython-dev/xenial,xenial,now 2.7.11-1 amd64 [installed,automatic]
libpython-stdlib/xenial,xenial,now 2.7.11-1 amd64 [installed]
libpython2.7/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
libpython2.7-dev/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
libpython2.7-minimal/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
libpython2.7-stdlib/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
libpython3-dev/xenial,xenial,now 3.5.1-3 amd64 [installed,automatic]
libpython3-stdlib/xenial,xenial,now 3.5.1-3 amd64 [installed]
libpython3.5/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
libpython3.5-dev/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
libpython3.5-minimal/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
libpython3.5-stdlib/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
python/xenial,xenial,now 2.7.11-1 amd64 [installed]
python-all/xenial,xenial,now 2.7.11-1 amd64 [installed,automatic]
python-all-dev/xenial,xenial,now 2.7.11-1 amd64 [installed,automatic]
python-appindicator/now 12.10.1+16.04.20170215-0ubuntu1 amd64 [installed,local]
python-apt/xenial,xenial,now 1.1.0~beta1build1 amd64 [installed]
python-apt-common/xenial,xenial,xenial,xenial,now 1.1.0~beta1build1 all [installed]
python-aptdaemon/xenial,xenial,now 1.1.1+bzr982-0ubuntu14 all [installed,automatic]
python-aptdaemon.gtk3widgets/xenial,xenial,now 1.1.1+bzr982-0ubuntu14 all [installed,automatic]
python-attr/xenial,xenial,xenial,xenial,now 15.2.0-1 all [installed,automatic]
python-audit/xenial,now 1:2.4.5-1ubuntu2 amd64 [installed,automatic]
python-blinker/xenial,xenial,xenial,xenial,now 1.3.dfsg2-1build1 all [installed,automatic]
python-bluez/xenial,now 0.22-1 amd64 [installed]
python-boto/xenial,xenial,xenial,xenial,now 2.38.0-1ubuntu1 all [installed,automatic]
python-bs4/xenial,xenial,xenial,xenial,now 4.4.1-1 all [installed,automatic]
python-bzrlib/now 2.7.0-2ubuntu3.1 amd64 [installed,local]
python-cairo/xenial,xenial,now 1.8.8-2 amd64 [installed,automatic]
python-cffi-backend/xenial,xenial,now 1.5.2-1ubuntu1 amd64 [installed,automatic]
python-characteristic/xenial,xenial,now 14.3.0-1 all [installed]
python-chardet/xenial,xenial,xenial,xenial,now 2.3.0-2 all [installed]
python-cloudfiles/xenial,xenial,now 1.7.11-3 all [installed,automatic]
python-colorama/xenial,xenial,now 0.3.7-1 all [installed]
python-compizconfig/now 1:0.9.12.2+16.04.20160823-0ubuntu1 amd64 [installed,local]
python-configobj/xenial,xenial,xenial,xenial,now 5.0.6-2 all [installed]
python-crypto/now 2.6.1-6ubuntu0.16.04.2 amd64 [installed,local]
python-cryptography/now 1.2.3-1ubuntu0.1 amd64 [installed,local]
python-cups/xenial,now 1.9.73-0ubuntu2 amd64 [installed]
python-dateutil/xenial,xenial,xenial,xenial,now 2.4.2-1 all [installed,automatic]
python-dbus/xenial,xenial,now 1.2.0-3 amd64 [installed]
python-dbus-dev/xenial,xenial,xenial,xenial,now 1.2.0-3 all [installed]
python-debian/xenial,xenial,now 0.1.27ubuntu2 all [installed]
python-debtagshw/xenial,xenial,now 2.0.1ubuntu6 all [installed,automatic]
python-defer/xenial,xenial,now 1.0.6-2build1 all [installed,automatic]
python-deltarpm/xenial,now 3.6+dfsg-1build4 amd64 [installed,automatic]
python-dev/xenial,xenial,now 2.7.11-1 amd64 [installed]
python-dirspec/xenial,xenial,now 13.10-1ubuntu1 all [installed]
python-distlib/xenial,xenial,now 0.2.2-1 all [installed]
python-django/now 1.8.7-1ubuntu5.5 all [installed,local]
python-django-common/now 1.8.7-1ubuntu5.5 all [installed,local]
python-dnspython/xenial,xenial,xenial,xenial,now 1.12.0-1 all [installed,automatic]
python-ecdsa/xenial,xenial,xenial,xenial,now 0.13-2 all [installed,automatic]
python-enum34/xenial,xenial,xenial,xenial,now 1.1.2-1 all [installed,automatic]
python-extras/xenial,xenial,xenial,xenial,now 0.0.3-3 all [installed,automatic]
python-fixtures/xenial,xenial,xenial,xenial,now 1.3.1-2 all [installed,automatic]
python-gdbm/xenial,xenial,now 2.7.11-2 amd64 [installed]
python-gi/xenial,xenial,now 3.20.0-0ubuntu1 amd64 [installed]
python-gi-cairo/xenial,now 3.20.0-0ubuntu1 amd64 [installed,automatic]
python-glade2/xenial,xenial,now 2.24.0-4ubuntu1 amd64 [installed,automatic]
python-gnomekeyring/xenial,now 2.32.0+dfsg-3 amd64 [installed,automatic]
python-gobject/xenial,xenial,now 3.20.0-0ubuntu1 all [installed]
python-gobject-2/xenial,xenial,now 2.28.6-12ubuntu1 amd64 [installed]
python-gpgme/xenial,xenial,now 0.3-1.1 amd64 [installed,automatic]
python-gtk2/xenial,xenial,now 2.24.0-4ubuntu1 amd64 [installed,automatic]
python-gtk2-doc/xenial,xenial,xenial,xenial,now 2.24.0-4ubuntu1 all [installed,automatic]
python-html5lib/xenial,xenial,xenial,xenial,now 0.999-4 all [installed,automatic]
python-httplib2/xenial,xenial,xenial,xenial,now 0.9.1+dfsg-1 all [installed]
python-idna/xenial,xenial,xenial,xenial,now 2.0-3 all [installed,automatic]
python-imaging/now 3.1.2-0ubuntu1.1 all [installed,local]
python-ipaddr/xenial,xenial,xenial,xenial,now 2.1.11-2 all [installed,automatic]
python-ipaddress/xenial,xenial,xenial,xenial,now 1.0.16-1 all [installed,automatic]
python-ipy/xenial,xenial,now 1:0.83-1 all [installed,automatic]
python-junitxml/xenial,xenial,now 0.6-1.1ubuntu1 all [installed,automatic]
python-jwt/now 1.3.0-1ubuntu0.1 all [installed,local]
python-keyring/xenial,xenial,xenial,xenial,now 7.3-1ubuntu1 all [installed,automatic]
python-launchpadlib/now 1.10.3-3ubuntu0.1 all [installed,local]
python-lazr.restfulclient/xenial,xenial,xenial,xenial,now 0.13.4-5ubuntu1 all [installed,automatic]
python-lazr.uri/xenial,xenial,xenial,xenial,now 1.0.3-2build1 all [installed,automatic]
python-ldb/xenial,xenial,now 2:1.1.24-1ubuntu3 amd64 [installed]
python-libvirt/xenial,xenial,now 1.3.1-1ubuntu1 amd64 [installed,automatic]
python-libxml2/xenial,now 2.9.4-1+deb.sury.org~xenial+2 amd64 [installed,automatic]
python-linecache2/xenial,xenial,xenial,xenial,now 1.0.0-2 all [installed,automatic]
python-lockfile/xenial,xenial,xenial,xenial,now 1:0.12.2-1 all [installed,automatic]
python-lxml/xenial,xenial,now 3.5.0-1build1 amd64 [installed,automatic]
python-lzma/xenial,now 0.5.3-3 amd64 [installed,automatic]
python-meld3/xenial,xenial,now 1.0.2-2 all [installed,automatic]
python-mimeparse/xenial,xenial,xenial,xenial,now 0.1.4-1build1 all [installed,automatic]
python-minimal/xenial,xenial,now 2.7.11-1 amd64 [installed]
python-mysql.connector/xenial,xenial,now 2.0.4-1 all [installed,automatic]
python-mysqldb/xenial,xenial,now 1.3.7-1build2 amd64 [installed]
python-ndg-httpsclient/xenial,xenial,xenial,xenial,now 0.4.0-3 all [installed,automatic]
python-netifaces/xenial,xenial,now 0.10.4-0.1build2 amd64 [installed,automatic]
python-ntdb/xenial,now 1.0-9 amd64 [installed]
python-numpy/xenial,xenial,now 1:1.11.0-1ubuntu1 amd64 [installed,automatic]
python-oauth/xenial,xenial,xenial,xenial,now 1.0.1-5 all [installed,automatic]
python-oauthlib/xenial,xenial,xenial,xenial,now 1.0.3-1 all [installed]
python-obexftp/xenial,now 0.24-4build2 amd64 [installed]
python-oneconf/xenial,xenial,now 0.3.9 all [installed,automatic]
python-openssl/xenial,xenial,xenial,xenial,now 0.15.1-2build1 all [installed]
python-pam/xenial,xenial,now 0.4.2-13.2ubuntu2 amd64 [installed]
python-paramiko/xenial,xenial,xenial,xenial,now 1.16.0-1 all [installed,automatic]
python-pbr/xenial,xenial,xenial,xenial,now 1.8.0-4ubuntu1 all [installed,automatic]
python-pexpect/xenial,xenial,now 4.0.1-1 all [installed]
python-pil/now 3.1.2-0ubuntu1.1 amd64 [installed,local]
python-pip/now 8.1.1-2ubuntu0.4 all [installed,local]
python-pip-whl/now 8.1.1-2ubuntu0.4 all [installed,local]
python-piston-mini-client/xenial,xenial,now 0.7.5-0ubuntu2 all [installed,automatic]
python-pkg-resources/xenial,xenial,xenial,xenial,now 20.7.0-1 all [installed]
python-poppler/xenial,now 0.12.1-8.1 amd64 [installed,automatic]
python-ptyprocess/xenial,xenial,now 0.5-1 all [installed,automatic]
python-pyasn1/xenial,xenial,xenial,xenial,now 0.1.9-1 all [installed,automatic]
python-pyasn1-modules/xenial,xenial,xenial,xenial,now 0.0.7-0.1 all [installed,automatic]
python-pycurl/xenial,xenial,now 7.43.0-1ubuntu1 amd64 [installed]
python-pyodbc/xenial,now 3.0.7-0ubuntu2 amd64 [installed,automatic]
python-pyparsing/now 2.0.3+dfsg1-1ubuntu0.1 all [installed,local]
python-pypdf/xenial,xenial,now 1:1.13-3 all [installed,automatic]
python-pysqlite2/xenial,now 2.7.0-1 amd64 [installed,automatic]
python-qt4/xenial,now 4.11.4+dfsg-1build4 amd64 [installed,automatic]
python-qt4-dbus/xenial,now 4.11.4+dfsg-1build4 amd64 [installed]
python-renderpm/xenial,now 3.3.0-1 amd64 [installed]
python-reportlab/xenial,xenial,now 3.3.0-1 all [installed]
python-reportlab-accel/xenial,now 3.3.0-1 amd64 [installed]
python-requests/xenial,xenial,xenial,xenial,now 2.9.1-3 all [installed]
python-rpm/xenial,now 4.12.0.1+dfsg1-3build3 amd64 [installed,automatic]
python-samba/now 2:4.3.11+dfsg-0ubuntu0.16.04.11 amd64 [installed,local]
python-secretstorage/xenial,xenial,xenial,xenial,now 2.1.3-1 all [installed,automatic]
python-selinux/xenial,now 2.4-3build2 amd64 [installed,automatic]
python-semanage/xenial,now 2.3-1build3 amd64 [installed,automatic]
python-sepolgen/xenial,xenial,now 1.2.2-3 all [installed,automatic]
python-sepolicy/xenial,now 2.3-1 amd64 [installed,automatic]
python-serial/xenial,xenial,xenial,xenial,now 3.0.1-1 all [installed]
python-service-identity/xenial,xenial,xenial,xenial,now 16.0.0-2 all [installed,automatic]
python-setools/xenial,now 3.3.8+20151215-2 amd64 [installed,automatic]
python-setuptools/xenial,xenial,xenial,xenial,now 20.7.0-1 all [installed]
python-simplejson/xenial,xenial,now 3.8.1-1ubuntu2 amd64 [installed,automatic]
python-sip/xenial,now 4.17+dfsg-1build1 amd64 [installed,automatic]
python-six/xenial,xenial,xenial,xenial,now 1.10.0-3 all [installed]
python-software-properties/now 0.96.20.7 all [installed,local]
python-sqlite/xenial,now 1.0.1-12 amd64 [installed,automatic]
python-sqlitecachec/xenial,now 1.1.4-1 amd64 [installed,automatic]
python-sqlparse/xenial,xenial,xenial,xenial,now 0.1.18-1 all [installed,automatic]
python-squaremap/xenial,xenial,now 1:1.0.4-2 all [installed,automatic]
python-sss/now 1.13.4-1ubuntu1.8 amd64 [installed,local]
python-subunit/xenial,xenial,now 1.1.0-3 all [installed,automatic]
python-talloc/xenial,xenial,now 2.1.5-2 amd64 [installed]
python-tdb/xenial,xenial,now 1.3.8-2 amd64 [installed]
python-testtools/xenial,xenial,xenial,xenial,now 1.8.1-0ubuntu1 all [installed,automatic]
python-tk/xenial,xenial,now 2.7.11-2 amd64 [installed,automatic]
python-traceback2/xenial,xenial,xenial,xenial,now 1.4.0-3 all [installed,automatic]
python-twisted-bin/xenial,xenial,now 16.0.0-1 amd64 [installed]
python-twisted-core/xenial,xenial,xenial,xenial,now 16.0.0-1 all [installed]
python-twisted-web/xenial,xenial,xenial,xenial,now 16.0.0-1 all [installed]
python-tz/xenial,xenial,xenial,xenial,now 2014.10~dfsg1-0ubuntu2 all [installed,automatic]
python-ubuntu-sso-client/xenial,xenial,now 13.10-0ubuntu11 all [installed]
python-uniconvertor/xenial,now 1.1.5-2 amd64 [installed,automatic]
python-unittest2/xenial,xenial,xenial,xenial,now 1.1.0-6.1 all [installed,automatic]
python-urlgrabber/xenial,xenial,xenial,xenial,now 3.9.1-4.2ubuntu1 all [installed]
python-urllib3/now 1.13.1-2ubuntu0.16.04.1 all [installed,local]
python-vte/xenial,now 1:0.28.2-5ubuntu3 amd64 [installed,automatic]
python-wadllib/xenial,xenial,xenial,xenial,now 1.3.2-3 all [installed,automatic]
python-wheel/xenial,xenial,now 0.29.0-1 all [installed,automatic]
python-wxgtk3.0/xenial,now 3.0.2.0+dfsg-1build1 amd64 [installed,automatic]
python-wxversion/xenial,xenial,now 3.0.2.0+dfsg-1build1 all [installed,automatic]
python-xapian/xenial,xenial,now 1.2.22-2build1 amd64 [installed]
python-xdg/xenial,xenial,now 0.25-4 all [installed,automatic]
python-zeitgeist/xenial,xenial,now 0.9.16-0ubuntu4 all [installed,automatic]
python-zope.interface/xenial,xenial,now 4.1.3-1build1 amd64 [installed]
python2.7/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
python2.7-dev/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
python2.7-minimal/now 2.7.12-1ubuntu0~16.04.1 amd64 [installed,local]
python3/xenial,xenial,now 3.5.1-3 amd64 [installed]
python3-apport/now 2.20.1-0ubuntu2.10 all [installed,local]
python3-apt/xenial,xenial,now 1.1.0~beta1build1 amd64 [installed]
python3-aptdaemon/xenial,xenial,xenial,xenial,now 1.1.1+bzr982-0ubuntu14 all [installed]
python3-aptdaemon.gtk3widgets/xenial,xenial,xenial,xenial,now 1.1.1+bzr982-0ubuntu14 all [installed,automatic]
python3-blinker/xenial,xenial,xenial,xenial,now 1.3.dfsg2-1build1 all [installed,automatic]
python3-brlapi/now 5.3.1-2ubuntu2.1 amd64 [installed,local]
python3-bs4/xenial,xenial,xenial,xenial,now 4.4.1-1 all [installed,automatic]
python3-cairo/xenial,xenial,now 1.10.0+dfsg-5build1 amd64 [installed,automatic]
python3-cffi-backend/xenial,xenial,now 1.5.2-1ubuntu1 amd64 [installed,automatic]
python3-chardet/xenial,xenial,xenial,xenial,now 2.3.0-2 all [installed]
python3-colorama/xenial,xenial,now 0.3.7-1 all [installed]
python3-commandnotfound/now 0.3ubuntu16.04.2 all [installed,local]
python3-crypto/now 2.6.1-6ubuntu0.16.04.2 amd64 [installed,local]
python3-cryptography/now 1.2.3-1ubuntu0.1 amd64 [installed,local]
python3-cups/xenial,xenial,now 1.9.73-0ubuntu2 amd64 [installed,automatic]
python3-cupshelpers/xenial,xenial,xenial,xenial,now 1.5.7+20160212-0ubuntu2 all [installed,automatic]
python3-dbus/xenial,xenial,now 1.2.0-3 amd64 [installed]
python3-dbus.mainloop.pyqt5/xenial,now 5.5.1+dfsg-3ubuntu4 amd64 [installed,automatic]
python3-dbus.mainloop.qt/xenial,now 4.11.4+dfsg-1build4 amd64 [installed]
python3-debian/xenial,xenial,xenial,xenial,now 0.1.27ubuntu2 all [installed]
python3-defer/xenial,xenial,xenial,xenial,now 1.0.6-2build1 all [installed]
python3-dev/xenial,xenial,now 3.5.1-3 amd64 [installed]
python3-distlib/xenial,xenial,now 0.2.2-1 all [installed]
python3-distupgrade/now 1:16.04.22 all [installed,local]
python3-extras/xenial,xenial,xenial,xenial,now 0.0.3-3 all [installed,automatic]
python3-gdbm/xenial,xenial,now 3.5.1-1 amd64 [installed]
python3-gi/xenial,xenial,now 3.20.0-0ubuntu1 amd64 [installed]
python3-gi-cairo/xenial,xenial,now 3.20.0-0ubuntu1 amd64 [installed,automatic]
python3-html5lib/xenial,xenial,xenial,xenial,now 0.999-4 all [installed,automatic]
python3-httplib2/xenial,xenial,xenial,xenial,now 0.9.1+dfsg-1 all [installed,automatic]
python3-idna/xenial,xenial,xenial,xenial,now 2.0-3 all [installed,automatic]
python3-jwt/now 1.3.0-1ubuntu0.1 all [installed,local]
python3-linecache2/xenial,xenial,xenial,xenial,now 1.0.0-2 all [installed,automatic]
python3-louis/now 2.6.4-2ubuntu0.1 all [installed,local]
python3-lxml/xenial,xenial,now 3.5.0-1build1 amd64 [installed,automatic]
python3-magic/xenial,xenial,xenial,xenial,now 1:5.25-2ubuntu1 all [installed,automatic]
python3-mako/xenial,xenial,xenial,xenial,now 1.0.3+ds1-1ubuntu1 all [installed,automatic]
python3-markupsafe/xenial,xenial,now 0.23-2build2 amd64 [installed,automatic]
python3-mimeparse/xenial,xenial,xenial,xenial,now 0.1.4-1build1 all [installed,automatic]
python3-minimal/xenial,xenial,now 3.5.1-3 amd64 [installed]
python3-newt/xenial,xenial,now 0.52.18-1ubuntu2 amd64 [installed]
python3-oauthlib/xenial,xenial,xenial,xenial,now 1.0.3-1 all [installed,automatic]
python3-oneconf/xenial,xenial,now 0.3.9 all [installed,automatic]
python3-packagekit/now 0.8.17-4ubuntu6~gcc5.4ubuntu1.2 all [installed,local]
python3-pbr/xenial,xenial,xenial,xenial,now 1.8.0-4ubuntu1 all [installed,automatic]
python3-pexpect/xenial,xenial,xenial,xenial,now 4.0.1-1 all [installed,automatic]
python3-pil/now 3.1.2-0ubuntu1.1 amd64 [installed,local]
python3-pip/now 8.1.1-2ubuntu0.4 all [installed,local]
python3-piston-mini-client/xenial,xenial,now 0.7.5-0ubuntu2 all [installed,automatic]
python3-pkg-resources/xenial,xenial,xenial,xenial,now 20.7.0-1 all [installed]
python3-problem-report/now 2.20.1-0ubuntu2.10 all [installed,local]
python3-ptyprocess/xenial,xenial,xenial,xenial,now 0.5-1 all [installed,automatic]
python3-pyasn1/xenial,xenial,xenial,xenial,now 0.1.9-1 all [installed,automatic]
python3-pyatspi/xenial,xenial,xenial,xenial,now 2.18.0+dfsg-3 all [installed,automatic]
python3-pycurl/xenial,xenial,now 7.43.0-1ubuntu1 amd64 [installed]
python3-pykde4/xenial,now 4:4.14.2-0ubuntu6 amd64 [installed]
python3-pyqt4/xenial,now 4.11.4+dfsg-1build4 amd64 [installed]
python3-pyqt5/xenial,now 5.5.1+dfsg-3ubuntu4 amd64 [installed,automatic]
python3-pyqt5.qtsvg/xenial,now 5.5.1+dfsg-3ubuntu4 amd64 [installed,automatic]
python3-renderpm/xenial,xenial,now 3.3.0-1 amd64 [installed,automatic]
python3-reportlab/xenial,xenial,xenial,xenial,now 3.3.0-1 all [installed,automatic]
python3-reportlab-accel/xenial,xenial,now 3.3.0-1 amd64 [installed,automatic]
python3-requests/xenial,xenial,xenial,xenial,now 2.9.1-3 all [installed,automatic]
python3-setuptools/xenial,xenial,xenial,xenial,now 20.7.0-1 all [installed,automatic]
python3-sip/xenial,now 4.17+dfsg-1build1 amd64 [installed]
python3-six/xenial,xenial,xenial,xenial,now 1.10.0-3 all [installed]
python3-smbc/xenial,now 1.0.15.5-1 amd64 [installed,automatic]
python3-software-properties/now 0.96.20.7 all [installed,local]
python3-speechd/xenial,xenial,xenial,xenial,now 0.8.3-1ubuntu3 all [installed,automatic]
python3-subunit/xenial,xenial,xenial,xenial,now 1.1.0-3 all [installed,automatic]
python3-systemd/xenial,xenial,now 231-2build1 amd64 [installed,automatic]
python3-testtools/xenial,xenial,xenial,xenial,now 1.8.1-0ubuntu1 all [installed,automatic]
python3-traceback2/xenial,xenial,xenial,xenial,now 1.4.0-3 all [installed,automatic]
python3-unittest2/xenial,xenial,xenial,xenial,now 1.1.0-6.1 all [installed,automatic]
python3-uno/now 1:5.1.6~rc2-0ubuntu1~xenial2 amd64 [installed,local]
python3-update-manager/now 1:16.04.9 all [installed,local]
python3-urllib3/now 1.13.1-2ubuntu0.16.04.1 all [installed,local]
python3-virtualenv/now 15.0.1+ds-3ubuntu1 all [installed,local]
python3-wheel/xenial,xenial,now 0.29.0-1 all [installed,automatic]
python3-xapian1.3/xenial,now 1.3.4-0ubuntu1 amd64 [installed,automatic]
python3-xdg/xenial,xenial,xenial,xenial,now 0.25-4 all [installed,automatic]
python3-xkit/xenial,xenial,xenial,xenial,now 0.5.0ubuntu2 all [installed]
python3.5/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
python3.5-dev/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
python3.5-minimal/now 3.5.2-2ubuntu0~16.04.3 amd64 [installed,local]
root@hostname:~#

If it hasn’t been installed yet, just type ‘apt-get -y install python’ in order to install Python.

2. The next step is to make sure to install ‘pip’ or to install the ‘pip’ utility or program if it hasn’t been installed.

root@hostname:~# apt list --installed | grep python-pip

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libpipeline1/xenial,xenial,now 1.4.1-2 amd64 [installed]
python-pip/now 8.1.1-2ubuntu0.4 all [installed,local]
python-pip-whl/now 8.1.1-2ubuntu0.4 all [installed,local]
python3-pip/now 8.1.1-2ubuntu0.4 all [installed,local]
root@hostname:~#

The above command execution identified that ‘pip’ utility or program has already been installed. So, if it hasn’t been installed yet, just type ‘apt-get -y install python-pip’ to be able to install ‘pip’.

3. Another step is to make sure that django is installed. To be able to check whether django has been installed or not, just type the following command of ‘apt-get -y install python-django’. It can be shown in the following command execution :

root@hostname:/usr/local/bin# apt list --installed | grep python-django

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

python-django/now 1.8.7-1ubuntu5.5 all [installed,local]
python-django-common/now 1.8.7-1ubuntu5.5 all [installed,local]
root@hostname:/usr/local/bin#

Another command which can be used for installing Django web-based framework is by using ‘pip’. Below is the command for installing Django using ‘pip’ :

root@hostname:~# pip install django
Requirement already satisfied: django in /usr/local/lib/python2.7/dist-packages
root@hostname:~#

Since Django has already been installed, the above command will have no effect while generating a message that the requirement for Django installation has been satisfied or it has been met.

3 thoughts on “How to Install Django in Linux via Command Line

Leave a Reply