Opened 2 years ago

Closed 21 months ago

#33442 closed New feature (fixed)

contrib.gis.geoip does not support Country-Lite version from DBIP

Reported by: Nathan Humphreys Owned by: Claude Paroz
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Nathan Humphreys)

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.

Change History (5)

comment:1 by Nathan Humphreys, 2 years ago

Description: modified (diff)

comment:2 by Claude Paroz, 2 years ago

Triage Stage: UnreviewedAccepted
Type: BugNew feature
Version: 4.0dev

A patch is welcome. Unfortunately, per Django release policy, this will not enter 3.2.x, nor 4.0.x, as it's not a regression.

comment:3 by Mariusz Felisiak, 21 months ago

Has patch: set
Needs documentation: set
Owner: changed from nobody to Claude Paroz
Status: newassigned

comment:4 by Mariusz Felisiak, 21 months ago

Needs documentation: unset
Triage Stage: AcceptedReady for checkin

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 21 months ago

Resolution: fixed
Status: assignedclosed

In 1e5bbbb2:

Fixed #33442 -- Allowed GeoIP2 to use DB-IP Lite datasets.

Note: See TracTickets for help on using tickets.
Back to Top