django delete object

  1. Import the model from the Django application where the object exists.
  2. Use the get() method to retrieve the object you want to delete from the database.
  3. Call the delete() method on the object to remove it from the database.

Example:

from myapp.models import MyModel

obj = MyModel.objects.get(pk=1)
obj.delete()