Edgewall Software

Changes between Version 3 and Version 4 of TracDev/DevelopmentEnvironmentSetup


Ignore:
Timestamp:
Apr 26, 2008, 1:29:18 AM (16 years ago)
Author:
osimons
Comment:

Added information about mod_python and virtualenv.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/DevelopmentEnvironmentSetup

    v3 v4  
    9696  - Set type to console
    9797  - level to debug
     98
     99=== Alternative frontend: mod_python ===
     100
     101Virtualenv can also be used with Apache and mod_python, but as mod_python will be a system install it will not be aware of the virutalenv without some configuration. For development this is useful as one Apache can serve various development versions in a more permanent way. This method will use the system Python, but will add the libraries from the virtualenv.
     102
     103'''Step 1:''' Make a new frontend script that for instance can be stored in the virtualenv 'bin' directory.
     104
     105{{{
     106#!python
     107#myvirtualtrac.py
     108
     109import os
     110import site
     111site.addsitedir('/path/to/my/virtualenv/lib/python2.4/site-packages')
     112
     113from trac.web.modpython_frontend import handler
     114}}}
     115
     116'''Step 2:''' Update Apache config to use this script - add or update options according to the default mod_python setup like for instance found in TracModPython.
     117
     118{{{
     119# Extend the path so Apache will find your script on path
     120PythonPath "['/path/to/my/virtualenv/bin'] + sys.path"
     121
     122# Make mod_python use new frontend instead of trac.web.modpython_frontend
     123PythonHandler myvirtualtrac
     124}}}