-
Notifications
You must be signed in to change notification settings - Fork 33
Added option into collectstatic command to ignore post-processing errors #17
Conversation
…st-processing phase when files are missing.
This option is also quite handy when using comment in CSS; because the cache storage doesn't care whether the url declaration in the CSS file is in a comment or not. So, a missing file from a commented declaration is legal from my side. |
I'm seeing this, too. We've got some CSS that's got url()'s that refer to assets that are, say, served via an HttpRedirect in django-land and staticfiles barfs on them. I guess one question is: should ignoring the errors be the default behavior? Personally, I think it makes sense to just ignore the url errors. |
@philipn Honestly, i prefer errors raised by default, this way i'm informed in the first place an i know exactly what i'm doing when i'm ignoring them.
|
Totally agree with you about errors. This isn't necessarily an error, though. An exception is raised, but it's not always the case that there's anything wrong with the CSS or with the application. Sometimes the file may not be on the file system and that wasn't intended (as in your 404 example), but it could very well /not/ be producing a 404 -- it could just be served dynamically and not from the file system (this is what I was seeing). But I think it's fine either way. |
This looks like a good idea, but needs tests :) EDIT: and docs! |
OK, i'll add some tests and ping you back once done. EDIT: Arg, i'm so bad at docs :) Will be the occasion to tackle it. |
…into develop Conflicts: staticfiles/storage.py
@jezdez I've added tests and docs. |
When a file exists in many directories included in STATICFILES_DIRS, every files found were processed, and the last one was used fro the post-processing phase. According to the precedence, only the first file found should be (post-)processed.
I'm closing this pull request because it nos comes with a patch for #19. |
Opening back, since i'm struggling too much with github. |
@jezdez bump ! |
Another bump, would be very helpful to support this. |
another bump. I would really like to see this in core. Even better would be an option to log warnings instead of failing silently. |
Another bump. suffering too much badly. would be very helpful. btw I am using Dj-1.6.1 from django.contrib.staticfiles |
What is the exact option to make this work ? |
Added option into collectstatic command to ignore errors raised on post-processing phase when files are missing.
This way we can still continue to post-process the static files even when some files are missing. I've stumbled upon this issue when deploying last stable version of django-grappelli.