Python agent and Web2py web framework

Web2py is an open source framework for creating web-based Python applications. You can integrate the Python agent with your Web2py app to monitor your app's performance. For general install procedures, see Install the Python agent.

Integrate with Web2py

Choose the Web2py set-up you use from the list below for more information:

Runweb2py command

If you run your web application using the runweb2py command, use the following command:

NEW_RELIC_CONFIG_FILE=/some/path/newrelic.ini newrelic-admin run-program runweb2py

newrelic-admin is a script that wraps your application startup, so that the agent can monitor your application's major functions. For more on running the wrapper script, see Running the wrapper script.


When using Apache/mod_wsgi, you must manually insert code in the WSGI script file you are using in order to initialize the Python agent. For more info, see our mod_wsgi documentation.


For information on using Gunicorn with the agent, see Python agent and Gunicorn documentation.


For information on using uWSGI with agent, see the Python agent and uWSGI documentation.

For general install procedures, see Install the Python agent.

For more help

Additional documentation resources include:

If you need more help, check out these support and learning resources: