#33442: contrib.gis.geoip does not support Country-Lite version from DBIP
-----------------------------+--------------------------------------
     Reporter:  DonkeyOatie  |                    Owner:  nobody
         Type:  Bug          |                   Status:  new
    Component:  GIS          |                  Version:  4.0
     Severity:  Normal       |               Resolution:
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+--------------------------------------
Description changed by DonkeyOatie:

Old description:

> The
> {{{
> db_type
> }}}
> property of the geoip database metadata for the dbip (https://db-
> ip.com/db/lite.php) lite databases is being returned as "DBIP-Country-
> Lite"
>
> The check here then fails
>
> https://github.com/django/django/blob/stable/3.2.x/django/contrib/gis/geoip2/base.py#L107
>
> despite the database being in the mmdb format.
>
> I believe Django should support the (free) dbip lite databases as well as
> the commercial maxmind databases.
>
> Changing the above line to check for
>
> {{{
> if db_type.contains("Country"):
>     ...
> }}}
>
> would be sufficient.  As would a second check to check for
>
> {{{
>  if db_type.endswith("Country-") or db_type.endswith("Country-Lite"):
>     ...
> }}}
>
> A similar change would be required the the dbip City-Lite database to be
> supported.

New description:

 The
 {{{
 db_type
 }}}
 property of the geoip database metadata for the dbip (https://db-
 ip.com/db/lite.php) lite databases is being returned as "DBIP-Country-
 Lite"

 The check here then fails

 
https://github.com/django/django/blob/stable/3.2.x/django/contrib/gis/geoip2/base.py#L107

 despite the database being in the mmdb format.

 I believe Django should support the (free) dbip lite databases as well as
 the commercial maxmind databases.

 Changing the above line to check for

 {{{
 if db_type.contains("Country"):
     ...
 }}}

 would be sufficient.  As would a second check to check for

 {{{
  if db_type.endswith("Country") or db_type.endswith("Country-Lite"):
     ...
 }}}

 A similar change would be required the the dbip City-Lite database to be
 supported.

 I am happy to put in a pull request but I am also hoping we can find a way
 to get this into the 3.2.x branch as well as a future 4.x release if thats
 possible.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33442#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.a4ce4d24068dd18a48a38fe6a2d4bcd1%40djangoproject.com.

Reply via email to