Skip to content

Commit 25e01e0

Browse files
committed
fix(django): Detect running django based on the injected path
1 parent e7f8372 commit 25e01e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

instana/instrumentation/django/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def load_middleware_wrapper(wrapped, instance, args, kwargs):
168168
logger.debug("Instrumenting django")
169169
wrapt.wrap_function_wrapper('django.core.handlers.base', 'BaseHandler.load_middleware', load_middleware_wrapper)
170170

171-
if 'INSTANA_MAGIC' in os.environ:
171+
if '/tmp/.instana/python' in sys.path:
172172
# If we are instrumenting via AutoTrace (in an already running process), then the
173173
# WSGI middleware has to be live reloaded.
174174
from django.core.servers.basehttp import get_internal_wsgi_application

instana/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
# Module version file. Used by setup.py and snapshot reporting.
55

6-
VERSION = '1.37.3'
6+
VERSION = '1.37.4'

0 commit comments

Comments
 (0)