When using django to create a model, use model.IPAddressField
to create a field. When making migrations, the error is as follows:
IPAddressField has been removed except for support in historical migrations.
HINT: Use GenericIPAddressField instead.
According to the prompt message: Use GenericIPAddressField
instead of IPAddressField
.
Before version 1.1 of django, IPAddressField can be used normally, and after version 1.1, only GenericIPAddressField
can be used, because GenericIPAddressField
supports ipv6, and IPAddressField
only supports ipv4.