default_app_config application variable is deprecated in Django 3.2

This commit is contained in:
David Smith 2020-08-13 21:33:25 +01:00
parent 35c0abf24e
commit b8ab30683a
2 changed files with 9 additions and 2 deletions

View File

@ -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):

View File

@ -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'