Skip to content

Instantly share code, notes, and snippets.

@coordt
Created May 10, 2012 13:40
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 coordt/2653053 to your computer and use it in GitHub Desktop.
Save coordt/2653053 to your computer and use it in GitHub Desktop.
A WSGI file for an application with an example project for testing on a server
"""
Default template for WSGI definition. Assumes virtualenv is in the same
directory as this file, and is called virtualenv
"""
import os, sys, site
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
site.addsitedir('virtualenv/lib/python2.6/site-packages')
sys.path.insert(0, PROJECT_ROOT)
sys.stdout = sys.stderr
os.environ['DJANGO_SETTINGS_MODULE'] = '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