I have the following generic class based views built with Django Rest framework (DRF)
class ExampleDetail(generics.RetrieveUpdateDestroyAPIView):
queryse
I didn't tried it, but I think the following should work.
Call the DRF and poing by url.open or request
as this answer suggest
Example:
import requests
from django.shortcuts import render
def home(request):
# get the list of todos
response =
requests.get('https://jsonplaceholder.typicode.com/todos/')
# transfor the response to json objects
todos = response.json()
return render(request, "main_app/home.html", {"todos": todos})
Complete example
You can call the DRF and point by ajax request from any other view.