djangodjango-pipeline

django-pipeline FileNotFoundError when i perform manage.py collectstatic


It's last some lines of traceback :

  File "C:\PycharmDev\TestVirtualEnv\testEnv1\lib\site-packages\pipeline\compressors\__init__.py", line 247, in execute_command
    stdin=subprocess.PIPE, stderr=subprocess.PIPE)
  File "C:\Python34\Lib\subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "C:\Python34\Lib\subprocess.py", line 1112, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] ...

And in settings.py :

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_URL = '/static/'
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATIC_URL = '/static_prepared/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static_prepared'),
]
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)
PIPELINE = {
    'STYLESHEETS': {
        'static_prepared': {
            'source_filenames': (
              '*.css',
            ),
            'output_filename': 'colors.css'
        },
    },
    'JAVASCRIPT': {
        'static_prepared': {
            'source_filenames': (
              '*.js',
            ),
            'output_filename': 'stats.js',
        }
    }
}

What's wrong with me?

When i use manage.py collectstatic, it doesn't work at all with pipeline.

It seems like only works like there's no pipeline.

The same as without pipeline. Normal manage.py collectstatic.

Why that error has been occurred?

I already made static and static_prepared directory on os.path.join(BASE_DIR, ...) manually.

How can i set pipeline correctly?


Solution

  • Replace other name like

    PIPELINE = {
        'STYLE': {
            'static_prepared': {
                'source_filenames': (
                  '*.css',
                ),
                'output_filename': 'colors.css'
            },
        },
        'JSCRIPT': {
            'static_prepared': {
                'source_filenames': (
                  '*.js',
                ),
                'output_filename': 'stats.js',
            }
        }
    }