• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Django Middleware Instrumentation Filtering

The Python agent can now filter which Django middleware should be monitored. By default, all middleware will be instrumented.

Important

Middleware Instrumentation Filtering for Django is available for Python agent version 10.17.0 and higher. By default, all middleware will be instrumented. To change this configuration, check out our documentation.

Disable all Django middleware

Disabling instrumentation of middleware in Django can be done one of two ways:

  1. Set the NEW_RELIC_INSTRUMENTATION_DJANGO_MIDDLEWARE_ENABLED environment variable to False
  2. Set instrumentation.middleware.django.enabled = false in the configuration file.

Django middleware configuration settings

Middleware exclude/include rules

The agent follows these rules when determining which middleware to include or exclude for monitoring:

Copyright © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.