0

I'm using django and and python 3. I'm following a tutorial. But he's using an older version. Im getting the error:

JSON object must be str, not 'bytes'

This is my views.py

import json
import urllib.request


locu_widget_key = "2c6860bd479198xxxxxxxxxxxxxxxxxx"
locu_api = "8e438723a7e87d0e47e9e7xxxxxxxxxxxxxxxxxx"
url = "https://api.locu.com/v1_0/venue/search/?api_key=8e438723a7e87d0e47e9e751d5d0dad00abd"
json_obj = urllib.request.urlopen(url)
data = json.load(json_obj)



reqx = request.META.get("HTTP_COOKIE")

title = "<h1>Scrape</h1>"
context = {
    "site": "",
    "title": title,
    "links": myset,
    "request": reqx,
    "data": data
}
return render(request, "posts/display_soup.html", context)

how can I make this work? any help or guidance is welcome

losee
  • 2,190
  • 3
  • 29
  • 55

0 Answers0