import sys import os import locale sys.stdout = sys.stderr from paste.deploy import loadapp 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' 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:/home/mpuls/${TYPE}/production.ini')