Skip to content

Instantly share code, notes, and snippets.

@mgrouchy
Created June 21, 2010 05:21
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 mgrouchy/446431 to your computer and use it in GitHub Desktop.
Save mgrouchy/446431 to your computer and use it in GitHub Desktop.
import os
import sys
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(project)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
sys.stdout = sys.stderr # Prevents IOError on print
import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()
def application(environ, start_response):
environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
return _application(environ, start_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment