from django.core.files.storage import FileSystemStorage
+ Comes from http://www.djangosnippets.org/snippets/976/
+ (even if it already exists in S3Storage for ages)
+ See also Django #4339, which might add this functionality to core.
def get_available_name(self, name):
Returns a filename that's free on the target storage system, and
available for new content to be written to.
- Comes from http://www.djangosnippets.org/snippets/976/
- (even if it already exists in S3Storage for ages)
- # If the filename already exists, remove it as if it was a true file system
- os.remove(os.path.join(settings.MEDIA_ROOT, name))