File tree Expand file tree Collapse file tree
sentry_sdk/integrations/django Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from django .core import signals
1010
1111from sentry_sdk ._types import MYPY
12- from sentry_sdk .utils import HAS_REAL_CONTEXTVARS
12+ from sentry_sdk .utils import HAS_REAL_CONTEXTVARS , logger
1313
1414if MYPY :
1515 from typing import Any
@@ -287,7 +287,10 @@ def _patch_channels():
287287 if not HAS_REAL_CONTEXTVARS :
288288 # We better have contextvars or we're going to leak state between
289289 # requests.
290- raise RuntimeError (
290+ #
291+ # We cannot hard-raise here because channels may not be used at all in
292+ # the current process.
293+ logger .warning (
291294 "We detected that you are using Django channels 2.0. To get proper "
292295 "instrumentation for ASGI requests, the Sentry SDK requires "
293296 "Python 3.7+ or the aiocontextvars package from PyPI."
You can’t perform that action at this time.
0 commit comments