Skip to content

Commit 91d65e0

Browse files
Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES (#870)
* Update CHANGELOG.md * Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES Co-authored-by: Srikanth Chekuri <[email protected]>
1 parent 8bb1e74 commit 91d65e0

File tree

2 files changed

+2
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- `opentelemetry-instrumentation-asgi` ASGI: Conditionally create SERVER spans
2727
([#843](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/843))
2828

29+
- `opentelemetry-instrumentation-django` Django: fix issue preventing detection of MIDDLEWARE_CLASSES
2930

3031
## [1.8.0-0.27b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.8.0-0.27b0) - 2021-12-17
3132

instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _get_django_middleware_setting() -> str:
105105
# In Django versions 1.x, setting MIDDLEWARE_CLASSES can be used as a legacy
106106
# alternative to MIDDLEWARE. This is the case when `settings.MIDDLEWARE` has
107107
# its default value (`None`).
108-
if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", []) is None:
108+
if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", None) is None:
109109
return "MIDDLEWARE_CLASSES"
110110
return "MIDDLEWARE"
111111

0 commit comments

Comments
 (0)