Version 4 (modified by 14 years ago) ( diff ) | ,
---|
Table of Contents
virtualenv
Using virtualenv allows multiple Python applications to each have an independent set of Libraries to allow easier management of dependencies.
Install Python virtualenv
On linux install the virtualenv package using your package manager.
Ubuntu/debian:
aptitude install python-virtualenv
Windows:
- Install setup tools from http://pypi.python.org/pypi/setuptools
- Use easy_install to install virtualenv
easy_install virtualenv
Using virtualenv
- Create a new virtualenv for your application
virtualenv dependencydirectory
The above creates a directory called dependencydirectory and initializes a new virtualenv inside it.
- Activate the virtualenv
On Linux/MacOSX/*ix:
source dependencydirectory/bin/activate
On Windows:
TODO
Note: Steps 4 works only after step 2 has been executed in the current terminal.
- Download the required web2py version and place eden in the applications directory.
- Use the requirements.txt in the eden directory to install the dependencies
pip install -U -r requirements.txt
- Run web2py for development within this environment.
python web2py.py
Using a virtualenv with apache/mod_wsgi
Append the following to WSGIDaemonProcess in the config:
python-path=/home/web2py/dependencydirectory/lib/python2.6/site-packages
You can find further configuration details here -> http://code.google.com/p/modwsgi/wiki/VirtualEnvironments
Note: In the line above change python2.6 to your python version and the directory to match your directory
Using a virtualenv with uwsgi
Add -H path_to_dependencydirectory to your uwsgi parameters
You can find further details on this at -> http://projects.unbit.it/uwsgi/wiki/VirtualEnv