Edgewall Software

Changes between Version 8 and Version 9 of ModPython


Ignore:
Timestamp:
Jun 10, 2004, 8:43:00 PM (20 years ago)
Author:
rocky
Comment:

Moved the 'easy way' to be before the 'hard way'

Legend:

Unmodified
Added
Removed
Modified
  • ModPython

    v8 v9  
    2828== Setting up multiple projects ==
    2929
    30 === The hard way ===
     30=== The easy way ===
     31
     32The Trac mod_python handler handler supports a configuration option similar to Subversion's {{{SvnParentPath}}}, called {{{TracEnvParentDir}}}:
     33
     34{{{
     35<LocationMatch /trac>
     36  SetHandler mod_python
     37  PythonHandler trac.ModPythonHandler
     38  PythonOption TracEnvParentDir "/var/www/projects"
     39</LocationMatch>
     40}}}
     41
     42When you request the {{{/trac}}} URL, you will get a (currently very simple) listing of all subdirectories of the directory you set as {{{TracEnvParentDir}}}. Selecting any project in the list will bring you to the corresponding Trac instance. You should make sure that the configured directory only contains Trac environment directories that match the currently installed Trac version, because that is not checked prior the the generation of the project list.
     43
     44=== Or the hard way ===
    3145
    3246The Trac mod_python handler can be configured to serve multiple projects, as can be seen in the following simple example:
     
    4761This sets up two projects. The disadvantage of the approach used here is that you need one additional {{{<Location>}}} directive per Trac instance. Although you may be able to eliminate this using some mod_rewrite tricks, you can also make use of the built-in support for multiple projects, as described in the next section.
    4862
    49 === Or the easy way ===
    50 
    51 The Trac mod_python handler handler supports a configuration option similar to Subversion's {{{SvnParentPath}}}, called {{{TracEnvParentDir}}}:
    52 
    53 {{{
    54 <LocationMatch /trac>
    55   SetHandler mod_python
    56   PythonHandler trac.ModPythonHandler
    57   PythonOption TracEnvParentDir "/var/www/projects"
    58 </LocationMatch>
    59 }}}
    60 
    61 When you request the {{{/trac}}} URL, you will get a (currently very simple) listing of all subdirectories of the directory you set as {{{TracEnvParentDir}}}. Selecting any project in the list will bring you to the corresponding Trac instance. You should make sure that the configured directory only contains Trac environment directories that match the currently installed Trac version, because that is not checked prior the the generation of the project list.
    62 
    6363=== Adding authentication ===
    6464