django pipeline FileNotFoundError when the path is right

Question:

I’m trying to add pipeline to my django project. But it’s throwing me winerror 2 (FileNotFoundError) when I’m trying to execute collectstatic

settings.py

STATIC_URL = 'static/'
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
STATIC_ROOT = 'static'
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)

PIPELINE = {
    'PIPELINE_ENABLED': True,
    'STYLE': {
        'base': {
            'source_filenames': (
                'css\core\header.css',
                'css\core\reset.css',
                'css\core\style.css'
            ),
            'output_filename': 'css\core\base.css'
        },
    }
}
├───css  
│   ├───BRS  
│   │       journal.css  
│   │       journal.css.map  
│   │       journal.scss  
│   │  
│   ├───core  
│   │       form.css  
│   │       header.css  
│   │       images.css  
│   │       intro.css  
│   │       reset.css  
│   │       start.css  
│   │       style.css  
│   │       table.css  
│   │  
│   ├───Portfolio  
│   └───user  
│           user.css  
│           user.css.map  
│           user.scss  

I even changed the subprocess module to output the executable variable and I get None

Tried to change the STATIC_ROOT variable to BASE_DIR / "static" but that didn’t help

Expected static files to be compressed

Answers:

After a lot of debugging, I realized that django-pipeline is trying to execute the command /usr/bin/env yuglify --type=css --terminal, which does not work for me on windows. So I installed yuglfy with npm and changed the YUGLIFY_BINARY setting to the path to yuglify (important to a .cmd file).

Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.