Created
May 30, 2012 09:16
-
-
Save codeboy/2834916 to your computer and use it in GitHub Desktop.
test
This file contains 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
# -*- coding: utf-8 -*- | |
import os, sys, locale | |
import site, os | |
locale.setlocale(locale.LC_TIME,'ru_RU.utf8') | |
#projects_root = '/home/codeboy/xxx/svn2/' | |
# | |
#if projects_root not in sys.path: | |
# sys.path.append(projects_root) | |
#os.environ['DJANGO_SETTINGS_MODULE'] = 'unicom.settings' | |
##Запуск wsgi-обработчика | |
#import django.core.handlers.wsgi | |
#application = django.core.handlers.wsgi.WSGIHandler() | |
########### | |
vepath = '/home/codeboy/work/env2/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('/home/codeboy/xxx/svn4-final-merge2/') | |
sys.path.append('/home/codeboy/xxx/svn4-final-merge2/unicom') | |
sys.path.append('/home/codeboy/xxx/svn4-final-merge2/unicom/private') | |
# 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 | |
# import from down here to pull in possible virtualenv django install | |
from django.core.handlers.wsgi import WSGIHandler | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'unicom.settings' | |
application = WSGIHandler() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment