Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit e6139ee

Browse files
committed
Merge pull request #207 from ryanpitts/development
add New Relic for prod
2 parents efa813b + 0df2693 commit e6139ee

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

requirements/prod.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-r ../vendor/src/funfactory/funfactory/requirements/prod.txt
22
django_browserid
33
requests
4+
newrelic==1.10.2.38

vendor-local/src/django-browserid

Submodule django-browserid updated 51 files

wsgi/playdoh.wsgi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import os
22
import site
33

4+
newrelic_cfg_file = os.environ.get('NEW_RELIC_CONFIG_FILE')
5+
6+
if newrelic_cfg_file:
7+
import newrelic.agent
8+
newrelic.agent.initialize(newrelic_cfg_file,
9+
os.environ.get('NEW_RELIC_ENVIRONMENT'))
10+
newrelic_settings = newrelic.agent.global_settings()
11+
412
os.environ.setdefault('CELERY_LOADER', 'django')
513
# NOTE: you can also set DJANGO_SETTINGS_MODULE in your environment to override
614
# the default value in manage.py
@@ -15,4 +23,7 @@ import manage
1523
import django.core.handlers.wsgi
1624
application = django.core.handlers.wsgi.WSGIHandler()
1725

26+
if newrelic_cfg_file:
27+
application = newrelic.agent.wsgi_application()(application)
28+
1829
# vim: ft=python

0 commit comments

Comments
 (0)