[mod_python] Usage of VirtualHost with publisher or handler

Patrick Percot ppercot at free.fr
Thu May 27 20:00:06 EDT 2004


Hi,

It seems that a difference of behaviour between publisher and handler. 

I want to  put the request handlers in the  directory handled by Apache,
and the rest of the application in another directory. Perhaps you should
consider  it is  not the  best choice,  but I  noticed  some differences
between the two configurations :


First  config with  publisher,  I *DO  NOT  NEED* to  add the  directory
/var/www/myapp/web to PythonPath :

<VirtualHost myapp.muaddib>
	DocumentRoot /var/www/myapp/web
	ServerName myapp.muaddib

	SetHandler python-program
	PythonDebug On
	<Files *>
		PythonPath "sys.path + ['/usr/local/myapp']"
	</Files>
	PythonHandler mod_python.publisher

</VirtualHost>


Second  configuration  with  handler,  I  *NEED* to  add  the  directory
/var/www/myapp/web(2) to PythonPath :

<VirtualHost myapp2.muaddib>
	DocumentRoot /var/www/myapp/web2
	ServerName myapp2.muaddib

	SetHandler python-program
	PythonDebug On
	PythonHandler handler

	<Files *>
		PythonPath "sys.path + ['/var/www/myapp/web2'] + ['/usr/local/myapp']"
	</Files>

</VirtualHost>


I also noticed  that with a <Directory > directive, there  is no need to
add the directory path to PythonPath. 

I did not see anything about those differences of behaviour on the FAQ. 


Is this a feature or a bug ? ;)


À+
PP
-- 
Groupe Morbihannais d'Utilisateurs de Logiciels Libres http://www.tuxbihan.org
Identifiant Jabber: pp at amessage.de
GPG fingerprint = 1A4F E154 3D2C A20E E4CA  A543 7951 C5C2 E44A A0B5

Patrick Percot.



More information about the Mod_python mailing list