Document that "collectstatic --clear" deletes all files in the storage directory
|Reported by:||Owned by:||nobody|
|Cc:||Coen van der Kamp||Triage Stage:||Accepted|
|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 3 years ago by
|Component:||contrib.staticfiles → Documentation|
|Summary:||Dangerous / Surprising Behavior of "collectstatic --clear" → Document that "collectstatic --clear" deletes all files in the storage directory|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Uncategorized → Cleanup/optimization|