Я добавляю API в свой файлview.py в своем приложении. Я получаю ошибку атрибута:
from django.shortcuts import render
def home(request):
import requests
import json
api_request = request.POST.get("https://min-api.cryptocompare.com/data/v2/news/?lang=EN")
api = json.loads(api_request.content)
return render(request, 'home.html', {"api": api})
Ожидаемый результат — это данные, которые извлекаются из API.
Ошибка получения:
AttributeError at /
'NoneType' object has no attribute 'content'