Hi,
-- Maybe your module requests not present sufficient and check requests api module to use.
On Mon, Jan 6, 2020, 20:20 Yash Garg <gargyash512@gmail.com> wrote:
--
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'])print(geodata['country_name'])print(geodata['latitude'])print(geodata['longitude'])
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/34b7736d-f946-451b-b83b-de72d3329da0%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP5HUWrPwnwpST5gR0%2BEw496N%3Df6hfCJzFbawAXXT5zRRdLkzg%40mail.gmail.com.
No comments:
Post a Comment