[Mpuls-commits] r4889 - base/trunk/contrib/apache

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 8 10:59:24 CEST 2011


Author: bricks
Date: 2011-04-08 10:59:24 +0200 (Fri, 08 Apr 2011)
New Revision: 4889

Modified:
   base/trunk/contrib/apache/mpuls.wsgi
Log:
update mpuls.wsgi file for logging in mod_wsgi and using a virtual python environment


Modified: base/trunk/contrib/apache/mpuls.wsgi
===================================================================
--- base/trunk/contrib/apache/mpuls.wsgi	2011-04-08 08:54:25 UTC (rev 4888)
+++ base/trunk/contrib/apache/mpuls.wsgi	2011-04-08 08:59:24 UTC (rev 4889)
@@ -1,3 +1,7 @@
+# uncomment the following lines to use a virtual python environment for wsgi
+#activate_this = '/path/to/python-virt/bin/activate_this.py'
+#execfile(activate_this, dict(__file__=activate_this))
+
 import sys
 import os
 import locale
@@ -9,13 +13,17 @@
 TYPE=mpuls
 
 # Set correct app name and conf
-APP_NAME = '${TYPE}web'
-APP_PATH = '/home/mpuls/${TYPE}'
-SUB_PATH = APP_PATH+'/'+APP_NAME
-LIBMPULS_PATH = '/home/mpuls/${TYPE}/libmpuls'
-LIBFORMED_PATH = '/home/mpuls/${TYPE}/libformed'
-MPULSWEB_PATH = '/home/mpuls/${TYPE}/mpulsweb'
+APP_NAME = TYPE + 'web'
+APP_PATH = '/home/mpuls/' + TYPE
+SUB_PATH = APP_PATH + '/'+ APP_NAME
+LIBMPULS_PATH = '/home/mpuls/' + TYPE + '/libmpuls'
+LIBFORMED_PATH = '/home/mpuls/' + TYPE + '/libformed'
+MPULSWEB_PATH = '/home/mpuls/' + TYPE + '/mpulsweb'
+INI_PATH = APP_PATH + '/production.ini'
 
+# load the config for logging in mod_wsgi
+fileConfig(INI_PATH)
+
 if not SUB_PATH in sys.path: sys.path.append(SUB_PATH)
 if not LIBMPULS_PATH in sys.path: sys.path.append(LIBMPULS_PATH)
 if not LIBFORMED_PATH in sys.path: sys.path.append(LIBFORMED_PATH)
@@ -25,4 +33,4 @@
 working_set.add_entry(SUB_PATH)
 
 # Double check if path to config file is correct.
-application = loadapp('config:/home/mpuls/${TYPE}/production.ini')
+application = loadapp('config:' + INI_PATH )



More information about the Mpuls-commits mailing list