Django Ubuntu install guide. How to Install Django 1.9 on Ubuntu 15.10, Ubuntu 14.04 and Ubuntu 15.04. Django is a free and open source web application framework, written in Python, which follows the model–view–controller (MVC) architectural pattern. Django’s primary goal is to ease the creation of complex, database-driven websites.
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Some well-known websites that use Django are Pinterest, Instagram, Mozilla, The Washington Times and Disqus.
Django has many exciting features. Some of them are:
- Ridiculously Fast – Django was designed to help developers take applications from concept to completion as quickly as possible.
- Fully Loaded – Django includes dozens of extras you can use to handle common Web development tasks. Django takes care of user authentication, content administration, site maps, RSS feeds, and many more tasks — right out of the box.
- Reassuringly Secure – Django takes security seriously and helps developers avoid many common security mistakes, such as SQL injection, cross-site scripting, cross-site request forgery and clickjacking. Its user authentication system provides a secure way to manage user accounts and passwords.
- Exceedingly Scalable – Some of the busiest sites on the planet use Django’s ability to quickly and flexibly scale to meet the heaviest traffic demands.
- Incredibly Versatile – Companies, organizations and governments have used Django to build all sorts of things — from content management systems to social networks to scientific computing platforms.
How to Install Django on Ubuntu
There are 3 different ways to install Django on Ubuntu Systems – with pip, with virtualenv and with github repository.
Before you begin the Django installation, update the ubuntu system.
sudo apt-get update
Install Django via PIP
To begin, install python3-pip using the following command:
apt-get install python3-pip
which pip3
ln -s /usr/bin/pip3 /usr/bin/pip
Once installed, run the following command to check the version:
pip -V
After installing pip, install django using the pip command given below:
pip3 install django==1.9
The above command will install django version 1.9. If you want a different version, change the version number in the command given above.
After the installation is finished, run the following command to check the django version installed on the system:
django-admin --version
Install Django via Git Repository
You can also install Django from Git repository. For this you will need git installed on your server. You can install git with command given below:
apt-get install git -y
Now run the following command to clone the django git repository:
cd ~
git clone git://github.com/django/django django-dev
pip install -e django-dev/
Once installed, you can verify that Python is installed by typing python from your shell
This will make Django’s code importable, and will also make the django-admin utility command available. In other words, you’re all set!
When you want to update your copy of the Django source code, just run the command git pull from within the django directory. When you do this, Git will automatically download any changes.
If you want to use Django with a database, which is probably the case, you’ll also need a database engine. PostgreSQL is recommended, because we’re PostgreSQL fans, and MySQL, SQLite 3, and Oracle are also supported.
For more information please visit https://www.djangoproject.com/