Empty output with pipeline.finders
See original GitHub issueThe setting below generates empty JS/CSS files in STATIC_ROOT
STATICFILES_FINDERS = (
'pipeline.finders.FileSystemFinder',
'pipeline.finders.AppDirectoriesFinder',
'pipeline.finders.CachedFileFinder',
'pipeline.finders.PipelineFinder',
)
The ones below work, but they also copy the source JS/CSS when I run collectstatic
, which has to be manually removed. Is it a settings issue in my setup or is it a bug in django-pipeline?
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:12
Top Results From Across the Web
Django Pipeline generates empty file - python
I am using Django pipeline, however when I run "collectstatic" command, it generates all the files but my main css and js files...
Read more >Pipeline Documentation
Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression,.
Read more >Working with pipes on the Linux command line
One of the most powerful shell operators is the pipe ( | ). The pipe takes output from one command and uses it...
Read more >Pipelines API - GitLab Docs
List project pipelines ; updated_after, datetime, no, Return pipelines updated after the specified date. Expected in ISO 8601 format ( 2019-03-15T08:00:00Z ).
Read more >about Pipelines - PowerShell
In a pipeline, the commands are processed in order from left to right. The processing is handled as a single operation and output...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem, but I found this thread after some debugging and I found reason for that behaviour.
pipeline’s finders are doing a good job but only when
collectstatic
is used. During which all files are ignored (not copied toSTATIC_ROOT
) and only files from compression process are saved there (toSTATIC_ROOT
). By this it works perfect no crap in static root only results of compression process. But…In debug mode files are not compressed, but should be copied as they are to static root (compilation of less/sass is made later on those copied files). But because of the ignored list from finder classes, static files are not copied to static root for further usage, so
FileSystemFinder
can not find them.This is the course of problems: https://github.com/cyberdelia/django-pipeline/blob/master/pipeline/finders.py#L69-L117 https://github.com/cyberdelia/django-pipeline/blob/master/pipeline/glob.py#L29
Because of the above this for is never entered, and paths variable is never filled. The path variable is essential for ruther procedures to render script tags. https://github.com/cyberdelia/django-pipeline/blob/master/pipeline/packager.py#L26-L28
So basicly I see two options
collectstatic
purpose.collectstatic
and they will be useless because on production compressed files are used).Unfortunately I don’t have time right now for further digging or creating fixing pull request ;/, but I think my observations will help.
I am also thinking about inappropriate setting configuration as @addremove suggest, because file finders are able to find those files in static dir inside my apps, so I am not sure if we should blame django for that.
I have the same problem… pipeline.finders.* generates empty files while django.contrib.staticfiles.finders.* do generate files correctly but also copies every file in the static dir.