Document that "collectstatic --clear" deletes all files in the storage directory
|Reported by:||nina@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When calling "collectstatic --clear," I would expect that only static files would be deleted, but in fact all files in the static file folder were deleted.
I am using storages and s3boto to serve static content and media. Here are the related settings values:
INSTALLED_APPS = (
AWS_STORAGE_BUCKET_NAME = "bucketname"
MEDIA_URL = "%s.s3.amazonaws.com/" % AWS_STORAGE_BUCKET_NAME
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATIC_ROOT = os.path.join(VAR_ROOT, 'static')
STATIC_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
When I ran "collectstatic --clear," the media files and the static files were deleted, but I would expect that only static files would effected by this call.
Ideally this command would only effect static files, but at the very least there would be a warning in the documentation that this deletes all content in the static folder.
Change History (8)
comment:1 Changed 13 months ago by timo
- Component changed from contrib.staticfiles to Documentation
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from Dangerous / Surprising Behavior of "collectstatic --clear" to Document that "collectstatic --clear" deletes all files in the storage directory
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Uncategorized to Cleanup/optimization