From 0e973b9953ec590bccb0101dd81d36354e784607 Mon Sep 17 00:00:00 2001 From: Oguntunde Caleb Date: Fri, 12 May 2023 02:11:54 +0100 Subject: [PATCH] Follow naming convention --- docs/api-guide/settings.md | 2 +- rest_framework/settings.py | 2 +- rest_framework/views.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api-guide/settings.md b/docs/api-guide/settings.md index 4097c4171..dea2bfcd1 100644 --- a/docs/api-guide/settings.md +++ b/docs/api-guide/settings.md @@ -41,7 +41,7 @@ The `api_settings` object will check for any user-defined settings, and otherwis *The following settings control the basic API policies, and are applied to every `APIView` class-based view, or `@api_view` function based view.* -#### MIDDLEWARE_CLASSES +#### DEFAULT_MIDDLEWARE_CLASSES A list or tuple of middleware classes, that is run prior to calling the method handler. diff --git a/rest_framework/settings.py b/rest_framework/settings.py index 5f0406ba9..8b4a896f3 100644 --- a/rest_framework/settings.py +++ b/rest_framework/settings.py @@ -29,7 +29,7 @@ from rest_framework import ISO_8601 DEFAULTS = { # custom middleware class to run prior to calling the method handler - "MIDDLEWARE_CLASSES": [], + "DEFAULT_MIDDLEWARE_CLASSES": [], # Base API policies "DEFAULT_RENDERER_CLASSES": [ "rest_framework.renderers.JSONRenderer", diff --git a/rest_framework/views.py b/rest_framework/views.py index ecf43e62b..a4c53b60d 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -103,7 +103,7 @@ def exception_handler(exc, context): class APIView(View): # The following policies may be set at either globally, or per-view. - middleware_classes = api_settings.MIDDLEWARE_CLASSES + middleware_classes = api_settings.DEFAULT_MIDDLEWARE_CLASSES renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES parser_classes = api_settings.DEFAULT_PARSER_CLASSES authentication_classes = api_settings.DEFAULT_AUTHENTICATION_CLASSES