Created
March 26, 2013 13:26
-
-
Save capooti/5245341 to your computer and use it in GitHub Desktop.
Sample wsgi script to be used in Apache for a Django application
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
ALLDIRS = ['/home/capooti/.venvs/geonode/lib/python2.7/site-packages'] | |
import os | |
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 | |
import django.core.handlers.wsgi | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'geonode.settings' | |
application = django.core.handlers.wsgi.WSGIHandler() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment