import os
import sys
import site

sys.stdout = sys.stderr

# Project root
root = '/var/www/codeinthehole.com/builds/prod/'
sys.path.insert(0, root)

# Packages from virtualenv
activate_this = '/var/www/codeinthehole.com/virtualenvs/prod/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

# Set environmental variable for Django and fire WSGI handler 
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
os.environ['DJANGO_CONF'] = 'conf.prod'
import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response):
    return _application(environ, start_response)
@@ -307,16 +307,95 @@
 this))%0A%0A
+import newrelic.agent%0Anewrelic.agent.initialize('/etc/newrelic/newrelic.ini')%0A%0A
 # Set en
@@ -628,16 +628,51 @@
 dler()%0A%0A
+@newrelic.agent.wsgi_application()%0A
 def appl
@@ -733,28 +733,29 @@
 ion(environ, start_response)
+%0A

Add newrelic wrapper around wsgi process