We were stoked to see our friends at Heroku announce their public beta for Python. Having just announced our own public beta for our Python agent, we thought folks might want to get started with monitoring Django apps right away so we created a new ‘how to” guide on our support site. Here’s a short checklist of items covered in the article:
- Prep & opt in
Get your Django app running on Heroku using gunicorn described here, then opt into New Relic in the “Add-ons” section.
- Tell Heroku to install New Relic
Add one line to your requirements.txt (in your project’s root directory) that just says newrelic
Modify the web entry in your Procfile to start with bin/newrelic-admin run-program like this:
bin/newrelic-admin run-program bin/python hellodjango/manage.py run_gunicorn -b "0.0.0.0:$PORT" -w 3
New Relic works out of the box on Django, Flask and Bottle. If you’re not on one of those frameworks you may need need to follow specific instructions in our support article to enable the Python agent. If after following the instructions you find that the agent isn’t sending any data, we may ask you to send us a copy of the Python agent log file, which is captured in the Heroku web server log. Detailed instructions are available in our support article.
As always, if you have any questions, concerns or feedback, drop us a line at email@example.com. Happy monitoring!