Changes between Version 80 and Version 81 of TracPlugins
- Timestamp:
- Mar 18, 2015, 9:06:48 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracPlugins
v80 v81 15 15 To install `setuptools`, download the bootstrap module [http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py] and execute it as follows: 16 16 17 {{{ 17 {{{#!sh 18 18 $ python ez_setup.py 19 19 }}} … … 34 34 * Run: 35 35 36 {{{ 36 {{{#!sh 37 37 $ python setup.py bdist_egg 38 38 }}} … … 53 53 54 54 Some plugins, such as [trac:SpamFilter SpamFilter], are downloadable as an `.egg` file that can be installed with `easy_install`: 55 {{{ 56 easy_install TracSpamFilter55 {{{#!sh 56 $ easy_install TracSpamFilter 57 57 }}} 58 58 … … 60 60 61 61 If Trac reports permission errors after installing a zipped egg, and you would rather not bother providing a egg cache directory writable by the web server, you can get around it by simply unzipping the egg. Just pass `--always-unzip` to `easy_install`: 62 {{{ 63 easy_install --always-unzip TracSpamFilter-0.4.1_r10106-py2.6.egg62 {{{#!sh 63 $ easy_install --always-unzip TracSpamFilter-0.4.1_r10106-py2.6.egg 64 64 }}} 65 65 You should end up with a directory having the same name as the zipped egg (complete with `.egg` extension) and containing its uncompressed contents. … … 70 70 71 71 `easy_install` makes installing from source a snap. Just give it the URL to either a Subversion repository or a tarball/zip of the source: 72 {{{ 73 easy_install http://svn.edgewall.com/repos/trac/plugins/0.12/spam-filter-captcha72 {{{#!sh 73 $ easy_install http://svn.edgewall.com/repos/trac/plugins/0.12/spam-filter-captcha 74 74 }}} 75 75 … … 79 79 80 80 This is done in the `[components]` section of the configuration file. For example: 81 {{{ 81 {{{#!ini 82 82 [components] 83 83 tracspamfilter.* = enabled … … 98 98 99 99 If you are uncertain about the location of the egg, here's a small tip to help locate an egg (or any package). Just replace `myplugin` with whatever namespace the plugin uses (as used when enabling the plugin): 100 {{{ 100 {{{#!pycon 101 101 >>> import myplugin 102 102 >>> print myplugin.__file__ … … 109 109 110 110 To do this from the Apache configuration, use the `SetEnv` directive: 111 {{{ 111 {{{#!apache 112 112 SetEnv PYTHON_EGG_CACHE /path/to/dir 113 113 }}} … … 116 116 117 117 For example (for CGI): 118 {{{ 118 {{{#!apache 119 119 <Location /trac> 120 120 SetEnv TRAC_ENV /path/to/projenv … … 124 124 125 125 Or (for mod_python): 126 {{{ 126 {{{#!apache 127 127 <Location /trac> 128 128 SetHandler mod_python … … 138 138 '''Note''': that if you already use -initial-env to set the project directory for either a single project or parent you will need to add an additional -initial-env directive to the !FastCgiConfig directive: 139 139 140 {{{ 140 {{{#!apache 141 141 FastCgiConfig -initial-env TRAC_ENV=/var/lib/trac -initial-env PYTHON_EGG_CACHE=/var/lib/trac/plugin-cache 142 142 }}} … … 151 151 152 152 Try this from the command line: 153 {{{ 153 {{{#!sh 154 154 $ python -c "import pkg_resources" 155 155 }}} … … 205 205 206 206 You probably want to disable the second function for security reasons. In `trac.ini`, in the `[components]` section, add the line: 207 {{{ 207 {{{#!ini 208 208 trac.admin.web_ui.PluginAdminPanel = disabled 209 209 }}}