title: How to get Django 1.7 working on Ubuntu 14.04 with nginx and virtualenv using python 2.7 while having python 3.4 installed?
body: <p>I am a newbie to Django and Python installation. Intermediate with Ubuntu 14.04. </p>
  
  <p>These are my installations so far in my Ubuntu 14.04.</p>
  
  <pre><code>apt-get install python3-setuptools --force-yes -y ## for python3
  easy_install3 pip ## for python3
  apt-get install python-setuptools --force-yes -y ## for python2.7 or above
  easy_install pip ## for python2.7 or above
  apt-get install python-dev --force-yes -y ## because ubuntu 14.04 does not have dev version of python 2
  apt-get install python3-dev --force-yes -y ## because ubuntu 14.04 does not have dev version of python 3.4
  apt-get install links --force-yes -y ##a command line web browser
  apt-get install python-flup --force-yes -y ## connects python to uwsgi)
  
  apt-get install build-essential --force-yes -y ## 
  
  pip2 install django uwsgi virtualenv ## use pip to install django and uwsgi and virtualenv for python2
  pip3 install django uwsgi  ## use pip to install django and uwsgi for python3
  </code></pre>
  
  <p>For the full list, please look at <a href="https://gist.github.com/simkimsia/41c55e0c08eda42e2cb3#file-install-sh-L88" rel="nofollow">https://gist.github.com/simkimsia/41c55e0c08eda42e2cb3#file-install-sh-L88</a></p>
  
  <p>I am confused about the use of <code>virtualenv</code>.</p>
  
  <p>I want to prepare my ubuntu 14.04 server edition for a production level of Django 1.7 as much as possible.</p>
  
  <p>The reason why I installed multiple Python environment because I may have other Python apps running which require 3.4.</p>
  
  <p>My Django files are from bitbucket repository and I have git cloned them into <code>/var/virtual/WebApps/DjangoProject</code></p>
  
  <p>Inside <code>/var/virtual/WebApps/DjangoProject</code>, I have manage.py and other files and folders.</p>
  
  <p>Please advise on how do I get the Django project running for this situation. </p>
  
  <p>I am currently testing this setup on my virtualbox and vagrant.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>There will be at least 2 Django applications. 1 requires 2.7 python. The other requires 3.4 python.</p>
  
  <p>Let me add that this is a single server that will host the application, frontend, and database.</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>I have restarted with a fresh install of Ubuntu 14.04 and I started with Python 2.7.6 and Python 3.4.0.</p>
  
  <p>I then did <code>sudo apt-get install python-virtualenv</code> which I checked its version: <code>1.11.4</code>.</p>
  
  <p>I have created <code>~/virtualenvs/py2.7</code> and <code>~/virtualenvs/py3.4</code>. </p>
  
  <p>Inside <code>~/virtualenvs</code>, I did <code>virtualenv -p /usr/bin/python2 py2.7</code>
  and  <code>~/virtualenvs</code>, I did <code>virtualenv -p /usr/bin/python3 py3.4</code></p>
  
  <p>So how do I install python2 only libraries for the python 2 app?</p>
  
  <p>E.g. are <code>django-adminfiles</code>, <code>sorl-thumbnail</code>, <code>psycopg2</code></p>
  
  <p><strong>EDIT 5</strong></p>
  
  <p>Use <code>virtualenv --system-site-packages -p /usr/bin/python2 py2.7</code> instead</p>