Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: c3d7e335d3
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (20 sloc) 0.75 kB
import sys
import site
import os
project = '/usr/local/apps/nplcc/nplcc'
ve = '/usr/local/apps/nplcc/env'
vepath = os.path.join(ve, 'lib/python2.7/site-packages')
prev_sys_path = list(sys.path)
# add the site-packages of our virtualenv as a site dir
site.addsitedir(vepath)
# add the app's directory to the PYTHONPATH
sys.path.append(project)
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# reorder sys.path so new directories from the addsitedir show up first
new_sys_path = [p for p in sys.path if p not in prev_sys_path]
for item in new_sys_path:
sys.path.remove(item)
sys.path[:0] = new_sys_path
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
Jump to Line
Something went wrong with that request. Please try again.