Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import newrelic.agent first in wsgi app #7149

Merged
merged 1 commit into from May 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions wsgi/app.py
@@ -1,9 +1,6 @@
# flake8: noqa
import os

from bedrock.base.config_manager import config


# newrelic import & initialization must come first
# https://docs.newrelic.com/docs/agents/python-agent/installation/python-agent-advanced-integration#manual-integration
try:
import newrelic.agent
except ImportError:
Expand All @@ -17,6 +14,11 @@
else:
newrelic = False

import os

from bedrock.base.config_manager import config


IS_HTTPS = os.environ.get('HTTPS', '').strip() == 'on'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bedrock.settings')

Expand Down