django how to delete a db field

obj = get_object_or_404(modelname, name=name)
obj.delete()

Here is what the above code is Doing:
1. We’re using the get_object_or_404 function to get the object we want to delete.
2. We’re using the delete method on the object to delete it.
3. We’re using the redirect function to redirect the user to the index page.