[mod_python] Server address

Tiago Becker tiagobecker at gmail.com
Fri Aug 29 16:24:59 EDT 2008

Hello guys!

Im trying to make my own framework for mod python, because none of the
available suited my needs.

Im trying to get the server address, without the request object, but i
couldnt find in the documentation.. is that possible?

Heres why i need it: i import apache and a configuration file, but that
config need to know the server address.. as i import the files prior to the
function that handles the request, i dont have the req object...

from mod_python import apache
import sys, os

#my cfg
CFG = apache.import_module('cfg/cfg')
CFG.LOCAL_PATH = os.path.dirname( __file__ )

..other imports etc

def index(req):
    #this is ther var i would like to get outside the function
    CFG.URL = 'http://' + req.hostname

Thanks for your answers!

Tiago Becker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080829/81db3336/attachment.html

More information about the Mod_python mailing list