Closed julen closed 11 years ago
Hm, I've never had any problem in a 404 context. Can you find out why get_env(), in that case, would not return an Environment that contains your "css_common" bundle?
It might only be a coincidence that the error appeared in 404 environments. Due to the arbitrary nature of the issue and the given effects, I think this is a thread-safety issue as it's been newly-reported in issue #12 and miracle2k/webassets#217.
Hi,
Lately I'm receiving lots of
BundleError
exceptions because the underlying files django-assets is trying to read don't exist apparently (IOError
is raised). The source files defined in the bundles do exist though, as well as the merged bundles.For example, I have defined a bundle like this:
And referenced it in the templates:
All works fine so far and I can even confirm it from a
manage.py shell
session:On the other hand, from the tracebacks I can see the bundle is not being properly populated with the expected contents:
After analyzing webassets' and django-assets' source code, I suspect the environment isn't being properly set and instead it treats the bundle identifier as a filename, therefore raising
IOError
at a later stage.This seems to happen when visiting a non-existent URL and a 404 page is returned. Any relevant settings that might affect this are set to
False
, such asDEBUG
,ASSETS_DEBUG
, andASSETS_AUTO_BUILD