Skip to content

Instantly share code, notes, and snippets.

@toast38coza
Created June 23, 2012 09:50
Show Gist options
  • Save toast38coza/2977748 to your computer and use it in GitHub Desktop.
Save toast38coza/2977748 to your computer and use it in GitHub Desktop.
Ununtu upstart script to start django_gunicorn with New Relic
description "launch django app with gunicorn and new relic monitoring"
start on net-device-up
stop on shutdown
respawn
# this cd's into your app's base dir
chdir /var/www/<appname>/
# this sets the path to your newrelic.ini file
env NEW_RELIC_CONFIG_FILE=/var/www/<appname>/newrelic.ini
# this launches your app with gunicorn using new relic's admin tool
# note: in this case, /env/bin is my virtualenv. By running the command from your virtualenv's interpreter, you don't need to
# activate the env manually
exec /var/www/<appname>/env/bin/newrelic-admin run-program /var/www/<appname>/env/bin/gunicorn_django -w3
@lextoumbourou
Copy link

Thanks a lot for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment