Comments (7)
I can't reproduce your error, see and try branch fix-relpath
. Can you explain me what exactly what broke ? It's maybe in another part of pipeline, I suspect absolute_path
.
from django-pipeline.
I've tried that branch, however the error still occurs. The problem appears to be that the URLs to the compressed CSS are generated wrong - when I add the / to the end of my STATIC_ROOT, they appear correctly as /static/favourites/css/smart.css, but without, the path is just:
from django-pipeline.
Yes, the probably does appear to be in absolute_path
. If on line 198 here: https://github.com/cyberdelia/django-pipeline/blob/master/pipeline/compressors/__init__.py#L198 I change it to:
path = os.path.join(start, path)
(i.e., get rid of the os.path.dirname), then it works. I don't know if that has any side effects
from django-pipeline.
Can you help me with more detail on how to reproduce (settings, original url, incorrect and correct result url) ? I want to add a regression test for this bug. You can also try to write the test by yourself, if it's easier for you ;)
from django-pipeline.
If you change line 21 here: https://github.com/cyberdelia/django-pipeline/blob/master/tests/runtests.py#L21 to get rid of the / on the end of the STATIC_ROOT setting (which is similar to how my STATIC_ROOT is defined, without the /), then your tests will fail
from django-pipeline.
I have been digging into this a bit. I can confirm that @cnorthwood's suggestion, "(i.e., get rid of the os.path.dirname), then it works," does in fact have side effects. Anything with a relative URL (i.e. image resources defined in the css) get the wrong path (the path includes the css path in the image location).
I think the correct fix is to take @cnorthwood's suggestion and then to also change
public_path = self.absolute_path(asset_path, css_path)
to
public_path = self.absolute_path(asset_path, os.path.dirname(css_path))
in construct_asset_path.
I can set up a pull request for this, I guess. This is the fix that we're now using locally.
from django-pipeline.
@cgreene We had the same finding at the same time, it's in the fix-relpath branch, that will be merged soon in master and released.
@cnorthwood Thanks for the report and the help to make it reproducible.
from django-pipeline.
Related Issues (20)
- Compressed JS file corrupted/broken HOT 2
- [Question] Can you suggest a way to @import less code form a different app HOT 1
- Do there any blockers to bump new release? HOT 5
- Elastic Beanstalk Deployment with Platform Python 3.7 on Amazon Linux 2 Can't HOT 1
- Replace docs `PipelineCachedStorage` references with `PipelineManifestStorage` HOT 4
- Files Not Found (dupe of #699) HOT 7
- Refused to apply style from because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. HOT 1
- Tox error due to slimit test HOT 1
- Not support Django 4.0 HOT 6
- pipeline compression skips over js when using yuglify HOT 1
- storages.backends.s3boto3.S3Boto3Storage HOT 2
- [Feature Request]: self.request to context in render_js HOT 1
- [Question][Bug] Infile paramater value wrong after updating from 1.6.14 to 2.0.7
- [QUESTION] Should not found files not raise an error while executing collectstatic HOT 3
- Remove `manifesto` support HOT 2
- Release new version HOT 2
- Support for Django 4.2 HOT 3
- Relative sourceMappingURL paths are not updated when concatenating files (breaks builds on Django 4+)
- Version 3.1.0 corrupting sourceURL index maps and producing broken javascript
- No static file generated by django-pipeline
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-pipeline.