Relative paths in mod_python
Bruno Desthuilliers
bdesth.quelquechose at free.quelquepart.fr
Sun Mar 19 17:19:10 EST 2006
Ivo van der Sangen a écrit :
> I was wondering if I could use relative paths in a mod_python script. At
> the moment I am defining a constant string
> "/path/to/dir/where/script/resides". The problem with this is that when
> I move the script including files I use to get metadata I have to change
> this variable. The same problem occurs when I distribute the script; the
> person using it will first have to modify it, which is not what I want. Is
> it possible that a mod_python script has as current working directory
> the directory where the script resides? At the moment os.getcwd()
> returns '/'.
You could set this constant in the apache conf as a PythonOption. And/Or
you could post this question to mod_python's mailing list !-)
More information about the Python-list
mailing list