Skip to content

Instantly share code, notes, and snippets.

@rainerborene
Created July 12, 2010 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rainerborene/472812 to your computer and use it in GitHub Desktop.
Save rainerborene/472812 to your computer and use it in GitHub Desktop.
import os
import sys
import site
# Calculates the path based on location of WSGI script.
apache_configuration = os.path.realpath(os.path.dirname(__file__))
project = os.path.join(apache_configuration, 'nomedoprojeto')
sys.path.append(apache_configuration)
sys.path.append(project)
site.addsitedir('/home/usuario/apps_wsgi/.site-packages')
os.environ['PYTHON_EGG_CACHE'] = '/home/usuario/apps_wsgi/.python-eggs'
os.environ['DJANGO_SETTINGS_MODULE'] = 'nomedoprojeto.settings'
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