SLP: Python's virtualenv setup

Go up to the main SLP documents page (md)

Python has a virtualenv package, which allows one to keep the installed Python packages, as well as various Python versions, stored locally. This allows users to install the packages, and the Python version can differ from the system default.

EVERYBODY SHOULD BE ON PYTHON 3! We aren't using Python 2 any more.

The following are the steps to set up a Django app via virtualenv. This all works on the course server as a regular user.

  1. Create the virtualenv directory. Do this via virtualenv -p /usr/bin/python3 ~/venv-django-1.11.
  2. Install the packages that you need.
  3. Install the Django package into your virtual environment!
  4. Get the virtualenv library directory name.
  5. De-register the old Django app from the web server.
  6. Re-register the Django application.
  7. Test the site at http://server/django/user or http://server/user, where "server" is the course server, and "user" is the user who registered the file.