Edgewall Software

Changes between Version 2 and Version 3 of TracDev/AlternativeFrontends


Ignore:
Timestamp:
Mar 12, 2015, 5:43:42 AM (9 years ago)
Author:
Ryan J Ollos
Comment:

Page cleanup.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/AlternativeFrontends

    v2 v3  
    1 = Alternative frontends =
     1= Alternative frontends for development
    22
    3 == Alternative frontend: mod_python ==
     3== Alternative frontend: mod_python
    44
    5 Virtualenv 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 virtualenv 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.
     5Virtualenv can be used with Apache and mod_python, but as mod_python will be a system install it will not be aware of the virtualenv 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.
    66
    7 '''Step 1:''' Make a new frontend script that for instance can be stored in the virtualenv 'bin' directory.
    8 
    9 {{{
    10 #!python
     71. Make a new frontend script that for instance can be stored in the virtualenv `bin` directory.
     8 {{{#!python
    119#myvirtualtrac.py
    1210
     
    1715from trac.web.modpython_frontend import handler
    1816}}}
    19 
    20 '''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.
    21 
    22 {{{
     171. Update Apache config to use this script. Add or update options according to the default mod_python setup like for instance found in TracModPython.
     18 {{{#!apache
    2319# Extend the path so Apache will find your script on path
    2420PythonPath "['/path/to/my/virtualenv/bin'] + sys.path"
     
    2824}}}
    2925
    30 == Alternative frontend: mod_wsgi ==
     26== Alternative frontend: mod_wsgi
    3127
    32 Using Apache, mod_wsgi is a very good alternative to mod_python. Setting this up follows the same pattern, but for development escpecially there is one major advantage: It can quite easily be set up to auto-reload on code changes.
     28Using Apache, mod_wsgi is a very good alternative to mod_python. Setting this up follows the same pattern, but for development especially there is one major advantage: It can quite easily be set up to auto-reload on code changes.
    3329
    34 '''Step 1:''' Update a default TracModWsgi setup to make a deamonised process, and as of mod_wsgi 2.0 (this setup depends on >= 2.0) there is built-in support for custom paths and similar. Example of a full `VirtualHost` configuration:
    35 
    36 {{{
     301. Update a default TracModWsgi setup to make a daemonised process, and as of mod_wsgi 2.0 (this setup depends on >= 2.0) there is built-in support for custom paths and similar. Example of a full `VirtualHost` configuration:
     31 {{{#!apache
    3732<VirtualHost *:80>
    3833    ServerName virtualtrac.local
     
    6661</VirtualHost>
    6762}}}
    68 
    69 '''Step 2:''' Go to http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode and save the long Python script that follows the text 'Example code for such an automatic restart mechanism...'. Save it as `/path/to/my/virtualenv/bin/monitor.py`
    70 
    71 '''Step 3:''' A basic WSGI frontend script, save as `/path/to/my/virtualenv/bin/virtualtrac.wsgi`
    72 
    73 {{{
    74 #!python
     631. Go to [mod-wsgi:ReloadingSourceCode#Monitoring_For_Code_Changes ReloadingSourceCode] and save the Python script as `/path/to/my/virtualenv/bin/monitor.py`
     641. A basic WSGI frontend script, save as `/path/to/my/virtualenv/bin/virtualtrac.wsgi`
     65 {{{#!python
    7566
    7667import sys
     
    7869
    7970import os
    80 os.environ['TRAC_ENV_DIR'] = "/path/to/trac/project"
     71os.environ['TRAC_ENV_DIR'] = '/path/to/trac/project'
    8172# or, alternatively for multiple projects
    8273#os.environ['TRAC_ENV_PARENT_DIR'] = "/parent/path/to/many/projects"