Skip to content

Commit cd354f7

Browse files
gforcadajimfunk
authored andcommitted
Avoid a deprecation warning
`` RemovedInDjango41Warning: 'netfields' defines default_app_config = 'netfields.apps.NetfieldsConfig'. Django now detects this configuration automatically. You can remove default_app_config. ``
1 parent a4cb4cb commit cd354f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

netfields/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
from django import VERSION
2+
13
from netfields.managers import NetManager
24
from netfields.fields import (InetAddressField, CidrAddressField,
35
MACAddressField, MACAddress8Field)
46

5-
default_app_config = 'netfields.apps.NetfieldsConfig'
7+
# only keep it for django 3.1 and below
8+
if VERSION[0] < 3 or VERSION[0] == 3 and VERSION[1] < 2:
9+
default_app_config = 'netfields.apps.NetfieldsConfig'

0 commit comments

Comments
 (0)