I am fetching an external json file . Whenever I send the data in dictionary form to html page and reload it, The page doesn't opens instead that html file is downloaded.
def index(request):
data = urllib.request.urlopen("https://some/states_daily.json").read()
output = json.loads(data)
print(output)
return render(request,'index.html',{'countries':countries},{'states':output})
Can anyone help me on this issue?
You can try something like this,