Fixed #35091 -- Allowed GeoIP2 querying using IPv4Address/IPv6Address.

This commit is contained in:
Nick Pope 2024-01-07 07:15:40 +00:00 committed by GitHub
parent 53fc6ac649
commit cc56c22a24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 17 deletions

View file

@ -107,10 +107,11 @@ and given cache setting.
Querying
--------
All the following querying routines may take either a string IP address
or a fully qualified domain name (FQDN). For example, both
``'205.186.163.125'`` and ``'djangoproject.com'`` would be valid query
parameters.
All the following querying routines may take an instance of
:class:`~ipaddress.IPv4Address` or :class:`~ipaddress.IPv6Address`, a string IP
address, or a fully qualified domain name (FQDN). For example,
``IPv4Address("205.186.163.125")``, ``"205.186.163.125"``, and
``"djangoproject.com"`` would all be valid query parameters.
.. method:: GeoIP2.city(query)

View file

@ -59,6 +59,9 @@ Minor features
* :class:`~django.contrib.gis.db.models.Collect` is now supported on MySQL
8.0.24+.
* :class:`~django.contrib.gis.geoip2.GeoIP2` now allows querying using
:class:`ipaddress.IPv4Address` or :class:`ipaddress.IPv6Address` objects.
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~