Skip to content

Commit

Permalink
[fix] Avoid default_app_config Deprecation Warning in Django >= 3.2 (#…
Browse files Browse the repository at this point in the history
…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 <auvipy@gmail.com>
  • Loading branch information
bluppfisk and auvipy committed Jan 12, 2022
1 parent 88d3d24 commit 29228a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rest_framework_gis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import django

VERSION = (0, 18, 0, 'final')
__version__ = VERSION # alias

Expand All @@ -14,4 +16,5 @@ def get_version():
return version


default_app_config = 'rest_framework_gis.apps.AppConfig'
if django.VERSION < (3, 2):
default_app_config = 'rest_framework_gis.apps.AppConfig'

0 comments on commit 29228a4

Please sign in to comment.