Gracefully handle missing IPSTACK_ACCESS_KEY setting. Fixes #118
This commit is contained in:
parent
de814e2b03
commit
3e0ba04aea
1 changed files with 2 additions and 1 deletions
|
@ -101,7 +101,8 @@ def get_ipstack_geocoder(ip):
|
|||
return RESULT_CACHE[ip]
|
||||
ipstack_key = getattr(settings, 'IPSTACK_ACCESS_KEY', None)
|
||||
if ipstack_key is None:
|
||||
raise Exception("You must define IPSTACK_ACCESS_KEY in your setting to use ipstack.py geocoding")
|
||||
print("You must define IPSTACK_ACCESS_KEY in your setting to use ipstack.com geocoding")
|
||||
return IPStackResult({})
|
||||
call_url = IPSTACK_URL.format(ip, ipstack_key)
|
||||
|
||||
session = requests.Session()
|
||||
|
|
Loading…
Reference in a new issue