Re: JSONDecodeError

2020-01-06 Thread Mohamed A
According to the documentation <https://docs.python.org/3/library/json.html#json.loads> > If the data being deserialized is not a valid JSON document, a > JSONDecodeError > <https://docs.python.org/3/library/json.html#json.JSONDecodeError> will > be raised. > however

Re: JSONDecodeError

2020-01-06 Thread Integr@te System
or another way django httpxforwardedfor module. Nice. On Mon, Jan 6, 2020, 22:56 Integr@te System wrote: > Hi, > > Maybe your module requests not present sufficient and check requests api > module to use. > > > On Mon, Jan 6, 2020, 20:20 Yash Garg wrote: > >> JSON

Re: JSONDecodeError

2020-01-06 Thread Integr@te System
Hi, Maybe your module requests not present sufficient and check requests api module to use. On Mon, Jan 6, 2020, 20:20 Yash Garg wrote: > JSONDecodeError > Exception Value: > > Expecting value: line 1 column 1 (char 0) > > > why i'm getting this error? > &g

JSONDecodeError

2020-01-06 Thread Yash Garg
JSONDecodeError Exception Value: Expecting value: line 1 column 1 (char 0) why i'm getting this error? views.py- ip_address = request.META.get('HTTP_X_FORWARDED_FOR', '') response = requests.get('http://freegeoip.net/json/%s' % ip_address) geodata = json.loads(response) print(geodata['ip