How to install Django on Ubuntu 16.04. Terminal commands to install the Django Web Framework on Linux Ubuntu 16.04 Systems. Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, Django takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.
Django can be installed on Ubuntu, using two ways:
- From Packages – with the apt package manager.
- Through pip – with the pip tool – package manager for Python packages.
Install Django from Packages
Run the following commands to install Django from Packages:
sudo apt-get update
sudo apt-get install python-django
sudo apt-get install python3-django
Please note that install python-django command uses Python 2 with Django and install python3-django command will use Python 3 with Django.
Install Django through pip
Run the following commands to install Django from pip:
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python3-pip
Once the pip is installed, run the following command to install Django:
sudo pip install django
sudo pip3 install django
To be assured that the installation was successful, run the command “django-admin –version” in Terminal.
Once installed, Django can be uses to create a project using the django-admin command “django-admin startproject projectname”