diff --git a/rest_framework/filters.py b/rest_framework/filters.py index aea9d3a57..bdab97b58 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -48,7 +48,7 @@ if django_filters: warnings.warn( "The built in 'rest_framework.filters.FilterSet' is deprecated. " "You should use 'django_filters.rest_framework.FilterSet' instead.", - DeprecationWarning + DeprecationWarning, stacklevel=2 ) return super(FilterSet, self).__init__(*args, **kwargs) @@ -72,7 +72,7 @@ class DjangoFilterBackend(DFBase): warnings.warn( "The built in 'rest_framework.filters.DjangoFilterBackend' is deprecated. " "You should use 'django_filters.rest_framework.DjangoFilterBackend' instead.", - DeprecationWarning + DeprecationWarning, stacklevel=2 ) return super(DjangoFilterBackend, cls).__new__(cls, *args, **kwargs) diff --git a/rest_framework/routers.py b/rest_framework/routers.py index 87e58b015..a04bffc1a 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -333,7 +333,7 @@ class DefaultRouter(SimpleRouter): warnings.warn( "Including a schema directly via a router is now deprecated. " "Use `get_schema_view()` instead.", - DeprecationWarning + DeprecationWarning, stacklevel=2 ) if 'schema_renderers' in kwargs: assert 'schema_title' in kwargs, 'Missing "schema_title" argument.'