deleting database object django code example
Example 1: delete database entry using name django
obj = get_object_or_404(modelname, name=name)
obj.delete()
Example 2: django delete object
SomeModel.objects.filter(id=id).delete()
obj = get_object_or_404(modelname, name=name)
obj.delete()
SomeModel.objects.filter(id=id).delete()