Skip to content

Commit 52707a5

Browse files
committed
Document using the sandbox
1 parent cc31efa commit 52707a5

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

README.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ To use this API, you first construct either a ``geoip2.webservice.Client`` or
4747
``geoip2.webservice.AsyncClient``, passing your MaxMind ``account_id`` and
4848
``license_key`` to the constructor. To use the GeoLite2 web service instead of
4949
the GeoIP2 web service, set the optional ``host`` keyword argument to
50-
``geolite.info``.
50+
``geolite.info``. To use the Sandbox GeoIP2 web service instead of the
51+
production GeoIP2 web service, set the optional ``host`` keyword argument to
52+
``sandbox.maxmind.com``.
5153

5254
After doing this, you may call the method corresponding to request type
5355
(e.g., ``city`` or ``country``), passing it the IP address you want to look up.
@@ -68,7 +70,9 @@ Sync Web Service Example
6870
>>> # This creates a Client object that can be reused across requests.
6971
>>> # Replace "42" with your account ID and "license_key" with your license
7072
>>> # key. Set the "host" keyword argument to "geolite.info" to use the
71-
>>> # GeoLite2 web service instead of the GeoIP2 web service.
73+
>>> # GeoLite2 web service instead of the GeoIP2 web service. Set the
74+
>>> # "host" keyword argument to "sandbox.maxmind.com" to use the Sandbox
75+
>>> # GeoIP2 web service instead of the production GeoIP2 web service.
7276
>>> with geoip2.webservice.Client(42, 'license_key') as client:
7377
>>>
7478
>>> # Replace "city" with the method corresponding to the web service
@@ -118,7 +122,9 @@ Async Web Service Example
118122
>>> #
119123
>>> # Replace "42" with your account ID and "license_key" with your license
120124
>>> # key. Set the "host" keyword argument to "geolite.info" to use the
121-
>>> # GeoLite2 web service instead of the GeoIP2 web service.
125+
>>> # GeoLite2 web service instead of the GeoIP2 web service. Set the
126+
>>> # "host" keyword argument to "sandbox.maxmind.com" to use the Sandbox
127+
>>> # GeoIP2 web service instead of the production GeoIP2 web service.
122128
>>> async with geoip2.webservice.AsyncClient(42, 'license_key') as client:
123129
>>>
124130
>>> # Replace "city" with the method corresponding to the web service

geoip2/webservice.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ class AsyncClient(BaseClient):
220220
221221
:param host: The hostname to make a request against. This defaults to
222222
"geoip.maxmind.com". To use the GeoLite2 web service instead of the
223-
GeoIP2 web service, set this to "geolite.info".
223+
GeoIP2 web service, set this to "geolite.info". To use the Sandbox
224+
GeoIP2 web service instead of the production GeoIP2 web service, set
225+
this to "sandbox.maxmind.com". The sandbox allows you to experiment
226+
with the API without affecting your production data.
224227
:param locales: This is list of locale codes. This argument will be
225228
passed on to record classes to use when their name properties are
226229
called. The default value is ['en'].
@@ -379,7 +382,10 @@ class Client(BaseClient):
379382
380383
:param host: The hostname to make a request against. This defaults to
381384
"geoip.maxmind.com". To use the GeoLite2 web service instead of the
382-
GeoIP2 web service, set this to "geolite.info".
385+
GeoIP2 web service, set this to "geolite.info". To use the Sandbox
386+
GeoIP2 web service instead of the production GeoIP2 web service, set
387+
this to "sandbox.maxmind.com". The sandbox allows you to experiment
388+
with the API without affecting your production data.
383389
:param locales: This is list of locale codes. This argument will be
384390
passed on to record classes to use when their name properties are
385391
called. The default value is ['en'].

0 commit comments

Comments
 (0)