jschneier / django-storages

https://django-storages.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.76k stars 863 forks source link

AWS_S3_FILE_OVERWRITE should be False by default #959

Open WhyNotHugo opened 3 years ago

WhyNotHugo commented 3 years ago

All Django's builtin storages do not overwrite files by default -- they append a number when there's collision.

I've been using S3Boto3Storage for quite some time, and suddenly found that many of my files were mixed up -- models seems to have a reference to the wrong on-disk file. After some research, it turns out this particular storage overwrites files by default.

This is very undesirable behaviour -- it's the opposite of the default used by Django, and can (and has) easily result in data loss.

Issues with the current default:

hardenchant commented 3 years ago

Today, this default value led to incorrect behavior in my application. This is not normal. 😞