This documentation explains requirements and tips for integrating the Python agent with apps that use
mod_wsgi-express. To return to the general install instructions, go to Install the for Python agent.
The recommended integration procedure of running the admin script via the command line cannot be used with Apache/mod_wsgi.
A new feature, called
mod_wsgi-express, was introduced in version 4.1.0 of
mod_wsgi, and it offers an alternate way to integrate the agent.
If you are using
mod_wsgi-express with a WSGI application, it is possible to use the script's
--with-newrelic option with your app's startup command. Although the
mod_wsgi-express script and
--with-newrelic flag are different than the
newrelic-admin script, they serve the same purpose of configuring your application to wrap the execution of your server.
When using the
--with-newrelic option, make sure the Python agent is installed and you've created your
newrelic.ini config file.
For example, using the agent with Django may require a command similar to:
NEW_RELIC_CONFIG_FILE=newrelic.ini mod_wsgi-express start-server mysite/wsgi.py --with-newrelic
For more details, contact the Apache/mod_wsgi author on the mod_wsgi mailing list.