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.
--
Ticket URL: <https://code.djangoproject.com/ticket/33442>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
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>
* version: 4.0 => dev
* type: Bug => New feature
* stage: Unreviewed => Accepted
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/33442#comment:2>
* owner: nobody => Claude Paroz
* needs_docs: 0 => 1
* has_patch: 0 => 1
* status: new => assigned
Comment:
[https://github.com/django/django/pull/15892 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33442#comment:3>
* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33442#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"1e5bbbb2a866faf56e00eb744ab940e40e87d497" 1e5bbbb2]:
{{{
#!CommitTicketReference repository=""
revision="1e5bbbb2a866faf56e00eb744ab940e40e87d497"
Fixed #33442 -- Allowed GeoIP2 to use DB-IP Lite datasets.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33442#comment:5>