You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it seems that since django 1.9 specificaly this PR django/django@87d7824 it breaks the "collectstatic -c" since it tries to validate that the root directory exists (which is empty in out case) because the bucket.new_key fails if the key name is empty
In the case of django-storages, maybe we can check if the bucket exists or just return true if its empty? (I think I would go for the true if empty)
Here is the Traceback:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 176, in handle
collected = self.collect()
File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 89, in collect
self.clear_dir('')
File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 210, in clear_dir
if not self.storage.exists(path):
File "/app/.heroku/python/lib/python3.4/site-packages/storages/backends/s3boto.py", line 433, in exists
k = self.bucket.new_key(self._encode_name(name))
File "/app/.heroku/python/lib/python3.4/site-packages/boto/s3/bucket.py", line 622, in new_key
raise ValueError('Empty key names are not allowed')
ValueError: Empty key names are not allowed
The text was updated successfully, but these errors were encountered:
Thanks for the report. I'm torn between the 2 possible fixes. From a strictly correctness standpoint I think that checking for bucket existence makes more sense. The only time that doesn't matter in this case is when you have set the setting AWS_AUTO_CREATE_BUCKET.
Side note: looks like we should be using get_key for checking existence.
it seems that since django 1.9 specificaly this PR django/django@87d7824 it breaks the "collectstatic -c" since it tries to validate that the root directory exists (which is empty in out case) because the bucket.new_key fails if the key name is empty
In the case of django-storages, maybe we can check if the bucket exists or just return true if its empty? (I think I would go for the true if empty)
Here is the Traceback:
The text was updated successfully, but these errors were encountered: