You'll have to delete the old image manually.
The absolute path to the image is stored in your_image_field.path
. So you'd do something like:
os.remove(your_image_field.path)
But, as a convenience, you can use the associated FieldFile object, which gives easy access to the underlying file, as well as providing a few convenience methods. See http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield-and-fieldfile
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…