Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
[Fix bug 860266] Add NewRelic support
Browse files Browse the repository at this point in the history
  • Loading branch information
johngian committed Jun 10, 2013
1 parent d206303 commit fb27696
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions wsgi/playdoh.wsgi
@@ -1,17 +1,6 @@
import os
import site

try:
import newrelic.agent
except ImportError:
newrelic = False


if newrelic:
newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', False)
if newrelic_ini:
newrelic.agent.initialize(newrelic_ini)

os.environ.setdefault('CELERY_LOADER', 'django')
# NOTE: you can also set DJANGO_SETTINGS_MODULE in your environment to override
# the default value in manage.py
Expand All @@ -23,5 +12,16 @@ site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../')))
# manage adds /apps, /lib, and /vendor to the Python path.
import manage

try:
import newrelic.agent
except ImportError:
newrelic = False

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

if newrelic:
newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', False)
if newrelic_ini:
newrelic.agent.initialize(newrelic_ini)
application = newrelic.agent.wsgi_application()(application)

0 comments on commit fb27696

Please sign in to comment.