mozilla / django-product-details

Product and locale details for Mozilla products
https://product-details.mozilla.org/1.0/
BSD 3-Clause "New" or "Revised" License
27 stars 22 forks source link

Use requests for fetching remote data. #54

Closed Osmose closed 8 years ago

Osmose commented 8 years ago

The existing stdlib use failed on Python 3 due to the returned data being a bytes object instead of a string that json.loads could accept. Requests handles the decoding for us!

@pmclanahan r? I also added a very small test of the management command, we could add more tests later but this basically solves all my own needs.

pmclanahan commented 8 years ago

This looks great to me. I'm curious if there are any other opinions or concerns from users of the lib. Maybe someone from MDN or SUMO or AMO could weigh in?

Osmose commented 8 years ago

@mythmon @robhudson Thoughts?

mythmon commented 8 years ago

Sumo has requests pinned at 2.7.0 right now, so we would still be compatible with this change. The code looks equivalent to me. I don't have a problem with this.