[mod_python] Python API for doing subrequests? (was 'lookup')

Graham Dumpleton grahamd at dscpl.com.au
Sat Sep 2 23:52:50 EDT 2006


On 03/09/2006, at 1:18 PM, Chad Whitacre wrote:

> Graham,
>
> <snip>
>
> Thanks for the helpful explanation.
>
>> What exactly is it you want to do?
>
> I'm experimenting with using Subversion (svn) as a database for  
> content management. As you may know svn runs as an Apache module,  
> and I was looking at the possibility of interfacing with it from  
> Python w/o leaving Apache. Doesn't look like that's going to happen  
> though, which is fine. Just researching at this point.

Actually, that is relatively easy. The Trac system which is written  
in Python and
can run under mod_python accesses Subversion. It doesn't have to loop
back requests to access Subversion through mod_dav_svn though, it just
uses the Python wrappers for Subversion to access the Subversion
repository direct from the file system. In both the case of  
mod_dav_svn and
the use of Python wrappers under mod_python, the user is that of Apache
and so they quite happily coexist as Subversion by nature has to support
multiple concurrent accesses to the file system repository.

The difficultly is only in understanding the API of the Python  
wrappers for
Subversion. For an example of Subversion access from Python see the code
for the following Trac plugin as an example, especially the  
svn_helpers.py
code file in the tracrst directory.

   http://svn.pythonfr.org/public/pythonfr/utils/trac/rest_macro/

Graham


More information about the Mod_python mailing list