-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4379 from willkg/1442022-new-relic
fix bug 1442022 - nix new relic
- Loading branch information
Showing
3 changed files
with
0 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,8 @@ | ||
from __future__ import print_function | ||
|
||
import os | ||
import sys | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crashstats.settings') | ||
|
||
from django.core.wsgi import get_wsgi_application # noqa | ||
application = get_wsgi_application() | ||
|
||
|
||
try: | ||
import newrelic.agent | ||
except ImportError: | ||
newrelic = False | ||
|
||
|
||
if newrelic: | ||
newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', None) | ||
if newrelic_ini: | ||
if os.path.isfile(newrelic_ini): | ||
newrelic.agent.initialize(newrelic_ini) | ||
application = newrelic.agent.wsgi_application()(application) | ||
else: | ||
print( | ||
"NEWRELIC_PYTHON_INI_FILE set but file does not exist. " | ||
"Skipping to initialize newrelic agent.", | ||
file=sys.stderr | ||
) |