Skip to content

Commit 8b7b706

Browse files
committed
fix(django): Detect running django based on the injected path
1 parent 4a765bb commit 8b7b706

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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

0 commit comments

Comments
 (0)