﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27836	File Storage API: No way to delete directories?!?	jedie	nobody	"It seems not possible to cleanup orphaned directories via storage API [1]

The problem: The default filesystem storage will call `os.rename` on `storage.delete(name)` usage. So it's only possible to delete a file and not a directory.

Usecase:
I store files (via `models.FileField`) in a sub-directory with a random token (via `upload_to` callback).
I delete the file via `post_delete` model signal and call `storage.delete(file.path)`
Now i can only delete the sub directory if i implement a own routine and use `os.rmdir(path)` if the default filesystem storage is used.


[1] https://docs.djangoproject.com/en/dev/ref/files/storage/"	Cleanup/optimization	new	File uploads/storage	dev	Normal		file storage API		Unreviewed	0	0	0	0	0	0
