diff options
| author | Flavio Curella <flavio.curella@gmail.com> | 2015-07-30 12:24:08 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-07-31 10:09:06 -0400 |
| commit | 1e2362ca0f2805e91204a7b005e5aed293b40c9e (patch) | |
| tree | 9e772d65e7d63f3d222f900860a81fab46376fdf /django | |
| parent | 7f0953ce1f1e263a2a74db52d70cdf278840a1d2 (diff) | |
Refs #25184 -- Started deprecation for contrib.gis.geoip.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/geoip/base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/django/contrib/gis/geoip/base.py b/django/contrib/gis/geoip/base.py index 39a651f727..a1d476c0a5 100644 --- a/django/contrib/gis/geoip/base.py +++ b/django/contrib/gis/geoip/base.py @@ -1,5 +1,6 @@ import os import re +import warnings from ctypes import c_char_p from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS @@ -11,6 +12,7 @@ from django.contrib.gis.geoip.prototypes import ( ) from django.core.validators import ipv4_re from django.utils import six +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_bytes # Regular expressions for recognizing the GeoIP free database editions. @@ -81,6 +83,13 @@ class GeoIP(object): * city: The name of the GeoIP city data file. Defaults to 'GeoLiteCity.dat'; overrides the GEOIP_CITY settings attribute. """ + + warnings.warn( + "django.contrib.gis.geoip is deprecated in favor of " + "django.contrib.gis.geoip2 and the MaxMind GeoLite2 database " + "format.", RemovedInDjango20Warning, 2 + ) + # Checking the given cache option. if cache in self.cache_options: self._cache = cache |
