Created
November 23, 2012 00:30
-
-
Save GrahamDumpleton/4133450 to your computer and use it in GitHub Desktop.
New Relic version of manage.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save this as newrelic-manage.py in same directory as existing manage.py. | |
# | |
# Run as: | |
# | |
# NEW_RELIC_CONFIG_FILE=/some/path/newrelic.ini python newrelic-manage.py run_gunicorn | |
import os | |
import newrelic.agent | |
here = os.path.dirname(__file__) | |
script = os.path.join(here, 'manage.py') | |
config = os.environ.get('NEW_RELIC_CONFIG_FILE') | |
if config: | |
newrelic.agent.initialize(config) | |
execfile(script) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment