Site icon TechGit

How to Install Django on an Ubuntu 16.04 VPS

Django is a free and open source, Python-based web application framework. It is a set of useful components that help developers to easily and quickly create their applications. Django is built and maintained by experienced developers and used by some of the world’s biggest companies and governments. Also, some of the most popular websites such as Instagram, Mozilla, Pinterest, The Washington Times and Disqus are using Django.

Django has tons of great features such as the following

In this tutorial, we will show you how to install Django on an Ubuntu 16.04 VPS through pip.

First of all login to your Ubuntu VPS as user root

ssh root@IP

It is a good practice to always update all installed packed on the server to the latest version. So once you are logged in, make sure that all packages are updated

apt-get update && apt-get upgrade

The best way to install Django globally is by using the Python package manager (pip). This way you will always install the latest available version of Django on your server.

Install pip on your server by executing the following command

apt-get install python-pip

Or you can use Python3, as recommended by Django.

apt-get install python3-pip

You can find more detailed information about the pip installation in one of our previous blog posts.

Check if pip is successfully installed

# pip -V
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

or for Python 3 run

# pip3 -V
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)

Now, you can install Django with one single command

pip install django

or if you are using Python 3

pip3 install django

Check if Django is successfully installed on your server

django-admin --version
1.10.5

If you receive the following warning that you are using an old pip version

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

You can go ahead and update it

pip install --upgrade pip

 

Source

FacebookTwitterTumblrRedditLinkedInHacker NewsDiggBufferGoogle ClassroomThreadsXINGShare
Exit mobile version