jazzband / django-pipeline

Pipeline is an asset packaging library for Django.
https://django-pipeline.readthedocs.io/
MIT License
1.52k stars 372 forks source link

GzipManifestPipelineStorage could not find file #618

Open pythdasch opened 7 years ago

pythdasch commented 7 years ago

Hi,

thanks for this nice library !

All is doing fine when I collectstatic, it normally creates the cache files, all seems fine.

`Post-processed 'compiled/dashboard.min.css' as 'compiled/dashboard.min.7058dfd4311a.css'
Post-processed 'compiled/common.min.js' as 'compiled/common.min.ccc4b6941036.js'
Post-processed 'compiled/form.min.js' as 'compiled/form.min.f919b770e800.js'
Post-processed 'compiled/dashboard.min.js' as 'compiled/dashboard.min.a9893fbed25e.js'

` but when I get on the website :

I have a 500 error because of : ValueError at / The file ‘compiled/compiled.min.css’ could not be found with <core.custom_storage.GzipManifestPipelineStorage object at 0x7f1bd2aa87d0>.

That's strange that he doesn't look for the cached version of compiled/compiled.min.css ...

when I do a ./manage.py findstatic compiled/compiled.min.css it doesn't find it.

So I guess there is a problem to generate it.

Here is my custom storage :

from pipeline.storage import PipelineMixin
from whitenoise.django import GzipManifestStaticFilesStorage

class GzipManifestPipelineStorage(PipelineMixin, GzipManifestStaticFilesStorage):
pass

Here are my pipeline settings:

` PIPELINE = {
    'PIPELINE_ENABLED': False,
    'JAVASCRIPT': {
        'common': {
            'source_filenames': (
              'script/jquery-2.1.4.min.js',
              'script/jquery-ui.min.js',
              'script/bootstrap.min.js',
              'script/idangerous.swiper.min.js',
              'script/jquery.viewportchecker.min.js',
              'script/js/jquery.countTo.js',
              'script/js/ajax-utils.js',
              'script/js/global.js',
              'script/js/words.js',
            ),
            'output_filename': 'compiled/common.min.js',
        },
        "forms": {
            'source_filenames': (
                'script/plugins/typeahead.bundle.min.js',
                'script/plugins/jquery.tagsinput.js',
                'script/js/search-city.js',
            ),
            'output_filename': 'compiled/form.min.js',
        },
        "dashboard": {
            'source_filenames': (
                'dash/js/bootstrap.min.js',
                'script/js/ajax-utils.js',
                'script/js/search-city.js',
                'dash/js/dashboard.js',
                'script/jquery.viewportchecker.min.js',
                'script/js/global.js',
                'script/js/jquery.countTo.js',
                'dash/js/plugins/flot/jquery.flot.js',
                'dash/js/plugins/flot/jquery.flot.tooltip.min.js',
                'dash/js/plugins/flot/jquery.flot.resize.js',
                'dash/js/plugins/flot/jquery.flot.pie.js',
                'dash/js/plugins/flot/flot-data.js',
            ),
            'output_filename': 'compiled/dashboard.min.js',
        },
    },
    'STYLESHEETS': {
        'common': {
            'source_filenames': (
                'style/*.css',
                'css/likely.css',
                'css/picker.css',
                'style/bootstrap.min.css',
                'css/compiled.css',
                ),
            'output_filename': 'compiled/compiled.min.css',
        },
        'dashboard': {
            'source_filenames': (
                'style/bootstrap.min.css',
                'css/compiled.css',
                'css/picker.css',
                'dash/css/sb-admin.css',
                'dash/css/plugins/morris.css'
                ),
            'output_filename': 'compiled/dashboard.min.css',
        },
    },

    'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor'
} `

In the logs the error is launch there :

File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 280, in stored_name
2017-02-14T12:03:30.772543473Z app[web.1]:     cache_name = self.clean_name(self.hashed_name(name))
2017-02-14T12:03:30.772545462Z app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 94, in hashed_name
2017-02-14T12:03:30.772547519Z app[web.1]:     (clean_name, self))

if someone can help me would it be awesome !

pythdasch commented 7 years ago

This is an issue with pipeline. I removed the lib and now all is working...