Created
November 5, 2012 12:14
-
-
Save settipalli/4016909 to your computer and use it in GitHub Desktop.
Django-virtualenv-wsgi-sample-configuration
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
# contents of a django wsgi file. | |
import os | |
import sys | |
SITE_PACKAGES_DIR='<absolute-path-to-virtualenv-folder>/lib/python2.7/site-packages' | |
DJANGO_PROJECT_PARENT_FOLDER='<absolute-path-to-django-project-folder>' | |
DJANGO_PROJECT_PATH='<absolute-path-to-django-project-app-folder>' | |
SETTINGS_FILE='settings' | |
# Add the virtual Python environment site-packages directory to the path | |
import site | |
site.addsitedir(SITE_PACKAGES_DIR) | |
sys.path = [DJANGO_PROJECT_PARENT_FOLDER] + sys.path | |
sys.path = [DJANGO_PROJECT_PATH] + sys.path | |
os.environ['DJANGO_SETTINGS_MODULE'] = SETTINGS_FILE | |
import django.core.handlers.wsgi | |
application = django.core.handlers.wsgi.WSGIHandler() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment