From b8ab30683a03f8c6af2dda27ba893920ea83bc92 Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 13 Aug 2020 21:33:25 +0100 Subject: [PATCH] default_app_config application variable is deprecated in Django 3.2 --- rest_framework/__init__.py | 6 +++++- rest_framework/authtoken/__init__.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index 8f2bc4466..483276e14 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -7,6 +7,8 @@ ______ _____ _____ _____ __ \_| \_\____/\____/ \_/ |_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_| """ +import django + __title__ = 'Django REST framework' __version__ = '3.11.0' __author__ = 'Tom Christie' @@ -22,7 +24,9 @@ HTTP_HEADER_ENCODING = 'iso-8859-1' # Default datetime input and output formats ISO_8601 = 'iso-8601' -default_app_config = 'rest_framework.apps.RestFrameworkConfig' + +if django.VERSION < (3, 2): + default_app_config = 'rest_framework.apps.RestFrameworkConfig' class RemovedInDRF313Warning(DeprecationWarning): diff --git a/rest_framework/authtoken/__init__.py b/rest_framework/authtoken/__init__.py index 82f5b9171..285fe15c6 100644 --- a/rest_framework/authtoken/__init__.py +++ b/rest_framework/authtoken/__init__.py @@ -1 +1,4 @@ -default_app_config = 'rest_framework.authtoken.apps.AuthTokenConfig' +import django + +if django.VERSION < (3, 2): + default_app_config = 'rest_framework.authtoken.apps.AuthTokenConfig'