Skip to content

Commit b8ab306

Browse files
committed
default_app_config application variable is deprecated in Django 3.2
1 parent 35c0abf commit b8ab306

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

rest_framework/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
\_| \_\____/\____/ \_/ |_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_|
88
"""
99

10+
import django
11+
1012
__title__ = 'Django REST framework'
1113
__version__ = '3.11.0'
1214
__author__ = 'Tom Christie'
@@ -22,7 +24,9 @@
2224
# Default datetime input and output formats
2325
ISO_8601 = 'iso-8601'
2426

25-
default_app_config = 'rest_framework.apps.RestFrameworkConfig'
27+
28+
if django.VERSION < (3, 2):
29+
default_app_config = 'rest_framework.apps.RestFrameworkConfig'
2630

2731

2832
class RemovedInDRF313Warning(DeprecationWarning):

rest_framework/authtoken/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
default_app_config = 'rest_framework.authtoken.apps.AuthTokenConfig'
1+
import django
2+
3+
if django.VERSION < (3, 2):
4+
default_app_config = 'rest_framework.authtoken.apps.AuthTokenConfig'

0 commit comments

Comments
 (0)