Skip to content

Instantly share code, notes, and snippets.

@cforcross
Last active September 22, 2021 15:46
Show Gist options
  • Save cforcross/07a472973d42271ea105cc948790d16f to your computer and use it in GitHub Desktop.
Save cforcross/07a472973d42271ea105cc948790d16f to your computer and use it in GitHub Desktop.
import requests,json
def index(request):
url ="https://min-api.cryptocompare.com/data/v2/news/?lang=EN"
res = requests.get(url)
if res.status_code == 200:
result = json.loads(res.content)
return render(request, 'index.html',{"result": result})
else:
print(f"{url} not valid")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment