This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:
Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.
See Instead:
This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.
As a prerequisite, we are assuming that you have gone through the article on how to set up your droplet and now you are ready for a Django project. If not, you can find the article here
First, we will log into droplet.
ssh –p 25000 demo@12.34.56.789
Remember to replace ‘2500’ with the number of port you used in the previous article.
Replace ‘demo’ with your username and ‘12.34.56.789’ with your droplet IP.
Django uses sqlite by default, but, you can use other databases like MySQL, PostgreSQL etc as well. In this article, we will not be using any database.
There are a number of optional packages that can be used with Django. Run the following command to install the optional packages.
sudo aptitude install python-imaging python-pythonmagick python-markdown python-textile python-docutils
If you want more information about the package then use ‘show’ subcommand with the respective package name.
aptitude show python-imaging
These packages are optional and frequently used. So it’s up to you if you want to use them with Django or not.
Now, we will download the Django unto our servers.
To date, this is not the recommended way of installing Django as it comes with an older version. However, if you still want to follow this method, you can use this command
sudo aptitude install python-django
Once it has download, you can check that Django is installed and working.
django-admin
The prompt will show the line below, followed by a long set of options.
Usage: django-admin subcommand [options] [args]
Move on to the Next Steps section at the end of the article.
If you don’t want to use aptitude, then this is your best bet for installing Django. In this method, we will download the official stable release and install it manually.
wget https://www.djangoproject.com/download/1.4/tarball/ tar xzvf index.html cd Django-1.4 sudo python setup.py install
You can use this command to check that Django is installed and working
django-admin.py
You should get below response, and it will be followed by a long set of options.
Usage: django-admin subcommand [options] [args]
If you are looking for the latest release of Django that supports all major features, then download the program through git.
Before you start, you need to download git:
apt-get install git-core
Once it downloads, you can install Django:
git clone https://github.com/django/django.git
Then more on the next steps.
By now, we are done with the installation of latest, stable release of Django. Now, we are ready to install a web server that will actually serve the Django app. There are a number of methods for installing web server but we will be focusing on mod_wsgi.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Usage: django-admin subcommand [options] [args]
what this? the options and args is mean?
I’m agree with pacofvf to use
It’s the recommended way to install Django (their words - https://docs.djangoproject.com/en/1.6/topics/install/#installing-an-official-release-with-pip)
helpxuezia@gmail.com: It means that django-admin is installed properly. You can now use it, try <code>django-admin help</code>.
this is not the recommended way to install Django or any python package for that matter, please use pip to avoid any version issues:
I appreciate your posting this! I use linode, but free tutorials like this are a great way to drive traffic. I’ll consider you guys in the future!