2

I used to use django-pipeline 1.2.6 and it never had problems finding the static files. After upgrading, it now cannot find where the heck the static files are. Not sure what's wrong, but I'm probably just missing something.

I'm getting this error:

ValueError: The file 'stylesheets/application.css.sass' could not be found with <pipeline.storage.PipelineFinderStorage object at 0x106e8b290>.

I'm using django 1.4. Here are my settings:

path = lambda *a: os.path.join(ROOT_PATH, *a)
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = path('assets/')
STATIC_URL = 'assets/'
STATICFILES_DIRS = ()
STATICFILES_FINDERS = (
  'django.contrib.staticfiles.finders.FileSystemFinder',
  'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
INSTALLED_APPS = (
  # ...
  'django.contrib.staticfiles',
  'pipeline',
  'app',
)
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_COMPILERS = (
  'pipeline.compilers.sass.SASSCompiler',
  'pipeline.compilers.coffee.CoffeeScriptCompiler',
)
PIPELINE_CSS = {
    'application': {
        'source_filenames': (
          'stylesheets/application.css.sass',
        ),
        'output_filename': 'stylesheets/application.css',
    },
}

PIPELINE_JS = {
  'application': {
    'source_filenames': (
      'javascripts/application.js.coffee',
    ),
    'output_filename': 'javascripts/application.js',
  }
}

Please help.

Interesting tidbit: If I remove PIPELINE_CSS entirely, it cannot find javascripts/application.js.coffee either.

Another interesting thing, no matter which version of django-pipeline I use, I get the following:

$ python manage.py findstatic stylesheets/application.css.sass
No matching file found for 'stylesheets/application.css.sass'.

What am I doing wrong?

1 Answer 1

3

If you have this, whatever version of pipeline your are using :

$ python manage.py findstatic stylesheets/application.css.sass
No matching file found for 'stylesheets/application.css.sass'.

It just means that django-staticfiles is misconfigured, once you figure that out, pipeline should work properly.

Where are you're static files stored ? In a static directory in each app, or for the whole project or else ?

3
  • 1
    It's stored in a static directory for the whole project under {project dir}/assets.
    – Kenneth
    May 28, 2012 at 19:00
  • You cannot store your static files inside STATIC_ROOT, staticfilesshould have issued you a warning about this.
    – cyberdelia
    May 29, 2012 at 9:22
  • Awesome! I changed static root to public and findstatic now works and so does the latest django-pipeline. Thanks cyberdelia!
    – Kenneth
    Jun 1, 2012 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.