Django - Delete file associated with ImageField attribute of Model

Deleting an ImageField keeps the file on the system.

Change your code to this to delete the file:

#insert at top of file
import os

elif request.method == 'DELETE':
    try:
        os.remove(request.user.avatar.path)
        request.user.avatar.delete()
        request.user.save()