@api_view(['DELETE']) # delete
def taskDelete(request, pk):
task = Task.objects.get(id=pk)
task.delete()
return Response('Item successfully deleted!')
This is an example above.
Why can you have special request methods like DELETE, PUT, PATCH etc. in Django REST Framework, but not in plain Django? Is it possible to create an API using just Django, as opposed to DRF? (I am just starting out with learning Django REST Framework, to create APIs.)