# 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 sys.stdout = sys.stderr from paste.deploy import loadapp from paste.script.util.logging_config import fileConfig from pkg_resources import working_set 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' 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) if not MPULSWEB_PATH in sys.path: sys.path.append(MPULSWEB_PATH) working_set.add_entry(MPULSWEB_PATH) working_set.add_entry(SUB_PATH) # Double check if path to config file is correct. application = loadapp('config:' + INI_PATH )