potatolondon/django-mediagenerator — Issue #4: In development mode, relative URL in CSS files sometimes does not get replaced... but sometimes does
Author: unicyclon
Created: 2012-01-21 15:00:12+00:00
State: open

Hello,

I'm currently running into an issue when serving CSS files which include relative URLs. The url() tag in my CSS file occasionally doesn't get replaced, which causes 404 errors. I'm investigating the issue, but couldn't find the pattern yet.

What I can tell is:

* When it doesn't get replaced, I'm getting ```ERROR:root:URL not found: ../img/head_sprite.png``` on my console

* Everything works perfectly in production mode

* Everything works perfectly if I remove reset.css from the bundle, but the contents of the file doesn't seem to have anything to do with it : any other CSS file causes the same issue

* Everything works perfectly with GENERATE_DATA_URIS on

--

In my app folder, I have the following folders:

```
+ static
+ img
- head_sprite.png
+ css
- main.css
- reset.css
```

The reset.css file is the standard YUI reset file. The main.css file is defined as:

```css
header {
display: block;
height: 45px;
background: #313131 url(../img/head_sprite.png) repeat-x;
}
```

And the media settings are:

```python
MEDIA_BUNDLES = (
('base.css',
'css/reset.css',
'core/css/base.css',
),
)
```