Skip to content

Commit 29228a4

Browse files
bluppfiskauvipy
andauthored
[fix] Avoid default_app_config Deprecation Warning in Django >= 3.2 (#268)
* make conditional on django version * [fix] Avoid default_app_config Deprecation Warning in Django >= 3.2 Django 3.2 started throwing deprecation warnings about the use of default_app_config in modules' __init__.py. The practice will start throwing errors in Django 4.1. This precludes future problems by only including the code if the Django version is below 3.2. * [fix] Flake8 formatting Co-authored-by: Asif Saif Uddin <[email protected]>
1 parent 88d3d24 commit 29228a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rest_framework_gis/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import django
2+
13
VERSION = (0, 18, 0, 'final')
24
__version__ = VERSION # alias
35

@@ -14,4 +16,5 @@ def get_version():
1416
return version
1517

1618

17-
default_app_config = 'rest_framework_gis.apps.AppConfig'
19+
if django.VERSION < (3, 2):
20+
default_app_config = 'rest_framework_gis.apps.AppConfig'

0 commit comments

Comments
 (0)