| | 1 | [[TOC]] |
| | 2 | = Using the Python virtualenv = |
| | 3 | |
| | 4 | == Install Python virtualenv == |
| | 5 | |
| | 6 | On linux install the virtualenv package using your package manager. |
| | 7 | |
| | 8 | Ubuntu/debian: |
| | 9 | |
| | 10 | {{{ |
| | 11 | aptitude install python-virtualenv |
| | 12 | }}} |
| | 13 | |
| | 14 | Windows: |
| | 15 | 1. Install setup tools from [http://pypi.python.org/pypi/setuptools] |
| | 16 | 2. Use easy_install to install virtualenv |
| | 17 | {{{ |
| | 18 | easy_install virtualenv |
| | 19 | }}} |
| | 20 | |
| | 21 | |
| | 22 | == Using virtualenv == |
| | 23 | |
| | 24 | 1. Create a new virtualenv for your application |
| | 25 | |
| | 26 | {{{ |
| | 27 | virtualenv dependencydirectory |
| | 28 | }}} |
| | 29 | |
| | 30 | The above creates a directory called dependencydirectory and initializes a new virtualenv inside it. |
| | 31 | |
| | 32 | 2. Activate the virtualenv |
| | 33 | |
| | 34 | On Linux/MacOSX/*ix: |
| | 35 | {{{ |
| | 36 | source dependecydirectory/bin/activate |
| | 37 | }}} |
| | 38 | |
| | 39 | On Windows: |
| | 40 | {{{ |
| | 41 | TODO |
| | 42 | }}} |
| | 43 | |
| | 44 | ''' |
| | 45 | Note: Steps 4 works only after step 2 has been executed in the current terminal.''' |
| | 46 | |
| | 47 | 3. Download the required web2py version and place eden in the applications directory. |
| | 48 | |
| | 49 | 4. Use the requirements.txt in the eden directory to install the dependencies |
| | 50 | |
| | 51 | {{{ |
| | 52 | pip install -U -r requirements.txt |
| | 53 | }}} |
| | 54 | |
| | 55 | 5. Run web2py for development within this environment. |
| | 56 | |
| | 57 | {{{ |
| | 58 | python web2py.py |
| | 59 | }}} |
| | 60 | |
| | 61 | == Using a virtualenv with apache/mod_wsgi == |
| | 62 | |
| | 63 | Append the following to WSGIDaemonProcess in the config: |
| | 64 | {{{ |
| | 65 | python-path=/home/web2py/dependencydirectory/lib/python2.6/site-packages |
| | 66 | }}} |
| | 67 | ''' |
| | 68 | Note: In the line above change python2.6 to your python version and the directory to match your directory''' |