yunojuno / django-geoip2-extras

Additional functionality using the GeoIP2 database and functions.
MIT License
8 stars 4 forks source link

Object of type 'GeoData' is not JSON serializable #6

Closed jaredfuelberth closed 4 years ago

jaredfuelberth commented 6 years ago

After installing and getting geoip2 to work on the python console, this error occurs when running the actual Django project. In line 86 of middleware.py in the repo:

request.session[GeoIP2Middleware.SESSION_KEY] = request.geo_data = data

If you run json.dumps(data), you will get the error.

image

AndrewNappin-lumen commented 5 years ago

Is this project going to get fixed?

hugorodgerbrown commented 4 years ago

Just cleaning this up. It's no longer relevant as the GeoData object is no longer serialized.