rvanlaar/djangorecipe — pull request #78 by dbreen (2013-07-25 20:07:53+00:00)
Title: Add a setting to append additional code to wsgi/fcgi deployment scripts

The existing `initialization` setting is handy for adding extra code to the wsgi files such as for loading celery, but for other purposes like New Relic integration, there's no way to wrap the `application` object with an agent. This change creates a new `deploy_script_extra` setting that appends its value to the .wsgi/.fcgi files.

Example usage:

deploy_script_extra =
import newrelic.agent
newrelic.agent.initialize('/etc/newrelic.ini', 'app')
application = newrelic.agent.WSGIApplicationWrapper(application)