Skip to content

Commit

Permalink
Avoid a deprecation warning
Browse files Browse the repository at this point in the history
``
RemovedInDjango41Warning: 'netfields' defines default_app_config = 'netfields.apps.NetfieldsConfig'. Django now detects this configuration automatically. You can remove default_app_config.
``
  • Loading branch information
gforcada authored and jimfunk committed Dec 13, 2023
1 parent a4cb4cb commit cd354f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netfields/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from django import VERSION

from netfields.managers import NetManager
from netfields.fields import (InetAddressField, CidrAddressField,
MACAddressField, MACAddress8Field)

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

0 comments on commit cd354f7

Please sign in to comment.