db_file_storage/model_utils.py
def delete_file(instance, filefield_name):
    """Delete the file (if any) from the database.

    Call this function immediately AFTER deleting the instance.
    """
    file_instance = getattr(instance, filefield_name)
    if file_instance:
        DatabaseFileStorage().delete(file_instance.name)
def delete_file(instance, filefield_name):
    """Delete the file (if any) from the database.

    Call this function immediately AFTER deleting the instance.
    """
    file_instance = getattr(instance, filefield_name)
    if file_instance:
        DatabaseFileStorage().delete(file_instance.name)
Delete the file (if any) from the database.

    Call this function immediately AFTER deleting the instance.