diff options
Diffstat (limited to 'archweb.wsgi')
-rw-r--r-- | archweb.wsgi | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/archweb.wsgi b/archweb.wsgi index 0d1798ab..901ac98f 100644 --- a/archweb.wsgi +++ b/archweb.wsgi @@ -17,6 +17,11 @@ try: import newrelic.agent from newrelic.api.exceptions import ConfigurationError try: + key_path = os.path.join(base_path, "newrelic.key") + if os.path.exists(key_path): + with open(key_path) as keyfile: + key = keyfile.read().strip() + os.environ["NEW_RELIC_LICENSE_KEY"] = key newrelic.agent.initialize(os.path.join(base_path, "newrelic.ini")) using_newrelic = True except ConfigurationError: @@ -28,9 +33,4 @@ import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() if using_newrelic: - _application = application - def application(environ, start_response): - os.environ["NEW_RELIC_LICENSE_KEY"] = environ.get("NEW_RELIC_LICENSE_KEY", None) - return _application(environ, start_response) - application = newrelic.agent.wsgi_application()(application) |