[Fixed]-How to delete individual files – Django 1.8

0👍

It is possible to write a custom function allows you to delete individual images. This may not be the best option but it works for me.

👤tim

1👍

Iterate over a forloop.

queryset=Photos.objects.filter(car_id = pk)
for img in queryset:
    img.delete()

or if you want to delete first image, then;

queryset[0].delete()

Leave a comment