Skip to content

collectstatic fails if CSS mentions an image file not in /static/ #70

@philipn

Description

@philipn

From @mivanov on August 22, 2012 20:49

Traceback after running collectstatic command:

Post-processed 'js/ckeditor/_samples/sample.css' as 'js/ckeditor/_samples/sample.73029ced5a94.css
Post-processed 'openlayers/theme/sapling/framedCloud.css' as 'openlayers/theme/sapling/framedCloud.d41d8cd98f00.css
Post-processed 'openlayers/theme/sapling/google.css' as 'openlayers/theme/sapling/google.a2e579db8ee8.css
Post-processed 'openlayers/theme/sapling/ie6-style.css' as 'openlayers/theme/sapling/ie6-style.af81e35e0dc2.css
Post-processed 'openlayers/theme/sapling/style.css' as 'openlayers/theme/sapling/style.2691bb9f9e74.css
Post-processed 'js/ckeditor/tests/qunit.css' as 'js/ckeditor/tests/qunit.37a4c1112878.css
Post-processed 'tagedit/css/ui-lightness/jquery-ui-1.8.6.custom.css' as 'tagedit/css/ui-lightness/jquery-ui-1.8.6.custom.8017548112e7.css
Traceback (most recent call last):
  File "/srv/sites/detroit/env/bin/localwiki-manage", line 8, in <module>
    load_entry_point('localwiki==0.4.0', 'console_scripts', 'localwiki-manage')()
  File "/srv/sites/detroit/env/lib/python2.6/site-packages/localwiki-0.4.0-py2.6.egg/sapling/manage.py", line 57, in main
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.6/dist-packages/django_staticfiles-1.2.1-py2.6.egg/staticfiles/management/commands/collectstatic.py", line 163, in handle_noargs
    collected = self.collect()
  File "/usr/local/lib/python2.6/dist-packages/django_staticfiles-1.2.1-py2.6.egg/staticfiles/management/commands/collectstatic.py", line 120, in collect
    for original_path, processed_path, processed in processor:
  File "/usr/local/lib/python2.6/dist-packages/django_staticfiles-1.2.1-py2.6.egg/staticfiles/storage.py", line 270, in post_process
    content = pattern.sub(converter, content)
  File "/usr/local/lib/python2.6/dist-packages/django_staticfiles-1.2.1-py2.6.egg/staticfiles/storage.py", line 213, in converter
    hashed_url = self.url(unquote(joined_result), force=True)
  File "/usr/local/lib/python2.6/dist-packages/django_staticfiles-1.2.1-py2.6.egg/staticfiles/storage.py", line 160, in url
    hashed_name = self.hashed_name(clean_name).replace('\\', '/')
  File "/usr/local/lib/python2.6/dist-packages/django_staticfiles-1.2.1-py2.6.egg/staticfiles/storage.py", line 123, in hashed_name
    (clean_name, self))
ValueError: The file '_files/welcome.jpg' could not be found with <staticfiles.storage.CachedStaticFilesStorage object at 0x2e161d0>.

Trying to find what's causing this...

(env)root@localwiki:/srv/sites/detroit/env/share/localwiki/themes/sapling-detroit# grep -R welcome.jpg *
assets/css/detroit.css: background-image: url(/front_page/_files/welcome.jpg);

So the most likely cause is this file.

Copied from original issue: localwiki/localwiki#326

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions