Created
November 10, 2012 14:58
-
-
Save kkszysiu/4051321 to your computer and use it in GitHub Desktop.
Pyramid using mod_wsgi on alwaysdata.net on virtualenv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home/pyramidtests/appsing_venv/bin/python | |
import os, sys | |
ALLDIRS = ['/home/pyramidtests/appsing_venv/lib/python2.6/site-packages/'] | |
import sys | |
import site | |
# Remember original sys.path. | |
prev_sys_path = list(sys.path) | |
# Add each new site-packages directory. | |
for directory in ALLDIRS: | |
site.addsitedir(directory) | |
# Reorder sys.path so new directories at the front. | |
new_sys_path = [] | |
for item in list(sys.path): | |
if item not in prev_sys_path: | |
new_sys_path.append(item) | |
sys.path.remove(item) | |
sys.path[:0] = new_sys_path | |
os.environ['PYTHON_EGG_CACHE'] = '/home/pyramidtests/tmp/' | |
_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
sys.path.insert(0, _PROJECT_DIR) | |
sys.path.insert(0, os.path.dirname(_PROJECT_DIR)) | |
#print "sys.path:", sys.path | |
from pyramid.paster import get_app, setup_logging | |
ini_path = '/home/pyramidtests/appsing_venv/web/appsing/development.ini' | |
setup_logging(ini_path) | |
application = get_app(ini_path, 'main') | |
#from paste.deploy import loadapp | |
#wsgi_app = loadapp('config:/home/pyramidtests/appsing_venv/web/appsing/development.ini') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment