First SSH Into your account (using putty, or terminal if you are on linux) where we will start by moving to our home directory (~) and creating a directory for the latest python.

cd ~
mkdir python27
tar xzvf Python-2.7.4.tgz
cd Python-2.7.4
./configure -prefix=/homeX/your_username/python27 --enable-unicode=ucs4
make install

We then add this python directory to our PATH environment variable and load it

sed -i '$ aPATH=/homeX/your_username/python27/bin:$PATH' ~/.bashrc
cd ~
source .bashrc

This will direct all ‘python’ commands to the python installation we just set-up.

(It is recommended that most users ignore the following: If you are using the built-in python for any reason, to have both simultaneously simply rename python27/bin/python to python27/bin/python27 and from here on out replace every instance of ‘python’ with ‘python27’.)

Now you can pause and test by typing


you should receive output like the following

Python 2.7.4 (default, Apr 14 2013, 08:29:07)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Now that we have python up and running lets start installing Django and its dependencies

  • Setuptools – prerequisite for pip
  • Pip – Python package manager
  • Flup – Python library for dealing with FastCGI


cd ~
tar xzvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python27 install


cd ~
tar xzvf pip-1.3.1.tar.gz
cd pip-1.3.1
python27 install


pip install flup

Now to Install Django 🙂

pip install Django

If you need to interface with any databases you can add them with the optional lines below

//for Mysql
pip install MySQL-python
//for Postgresql
pip install psycopg2

Congrats! Django is now setup on your server. You can confirm by typing



joao costa · May 28, 2013 at 6:11 am

I followed this guide but at the end I was unable to use psycopg2 due to wsfgi being compiled for python 2.6.6

Then I removed all python2.7.4 and did again all these steps but with python 2.6.6 and all is working fine now.

Yash · November 15, 2016 at 8:51 am

I am getting an error on entering this command:
./configure -prefix=/homeX/your_username/python27 –enable-unicode=ucs4
The error msg is :
checking for –enable-universalsdk… no
checking for –with-universal-archs… 32-bit
checking MACHDEP… linux2
checking machine type as reported by uname -m… x86_64
checking for –without-gcc… no
checking for gcc… no
checking for cc… no
checking for cl.exe… no
configure: error: in `/home/zealexai/src/Python-2.7.3′:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details

How can i install GCC once I ssh to my account? Please help. Thank you,

    Yash · November 16, 2016 at 11:29 pm

    Nevermind, the hosting provider din’t supported it.

Leave a Reply

%d bloggers like this: