How not to have the source files collected in `STATIC_ROOT` ?
See original GitHub issueCurrently upgrading from django-pipeline 1.3.27 to 1.6.6.
The new default configuration works fine except that I ended with too many files collected in STATIC_ROOT
.
Ok, so heading to the documentation, storage section:
If you want to exclude Pipelinable content from your collected static files, you can also use Pipeline’s FileSystemFinder and AppDirectoriesFinder. These finders will also exclude unwanted content like READMEs, tests and examples, which are particularly useful if you’re collecting content from a tool like Bower.
Nice, so I’ll try using pipeline.finders.FileSystemFinder
and pipeline.finders.AppDirectoriesFinder
instead of their django versions but now the compiling / compressing part no longer works because the compilers / compressors are looking for the source files in STATIC_ROOT
where there are no longer collected as wanted.
So now I collect the files I need + the source files, then run pipeline and finally remove the source files from STATIC_ROOT
but it just feels not right. (plus it’s not really fixed, if I have source.scss
compiled to source.css
compressed to output.css
, I’m still ending up with an unwanted source.css
in STATIC_ROOT
).
Previously we had pipeline.storage.PipelineFinderStorage
who used all the finders without the ignore_patterns
to find and use all the source files no matter if they were collected in STATIC_ROOT
in the end. This Storage was removed when pipeline.collector.default_collector
was introduced (I’m still confused about it’s purpose) and replaced by django’s stock staticfiles_storage
who cannot find the source files if they’re not copied in STATIC_ROOT
.
Related issues: https://github.com/jazzband/django-pipeline/issues/504 https://github.com/jazzband/django-pipeline/issues/503 but they have not attracted any response.
I’ll would be glad if someone could point me in the right direction. Am I wrongly using django-pipeline ? Because if not, at that point I may as well directly fix django-pipeline than hack around it but I would need some guidelines from a maintainer before starting to do so.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:8
Yeah, I just upgraded from 1.3x and things broke for me in dev. I had to set:
DEBUG = True PIPELINE[‘PIPELINE_ENABLED’] = False PIPELINE[‘PIPELINE_COLLECTOR_ENABLED’] = True
The switch to forcing files to be copied to STATIC_ROOT instead of just read from the original source dirs seems like an bad change. Every request requires it all to be recopied. It’s pretty slow in dev now. AND it copies in all the
.scss
and.coffee
files, since they need to be there for compilation, but aren’t cleaned up afterwards. ACK!The issue is this change from compiling from the source file path to compiling once it’s in STATIC_ROOT: https://github.com/jazzband/django-pipeline/commit/bd6b9d8966a5e00701d3a803c4977f20df7a282d#diff-54b8c27056913aafe149e01ff0aa5e46L35
I’d love to see a bit better documentation on how to setup a development environment.
In the older version of pipeline was possible to call collectstatic command with ignore parameter e.g:
But now it throws exception