CSS/Python/Django: automatic versioning of images referenced inside the stylesheet

nicz33

New Member
I just moved my CSS into its own document. It used to be written in a style tag in the header of my html template.However, now I have an issue with automatic versioning of my background images. My html template contained code (a Django tag) that looked up the last modified date of each image and then added this as the image version. It also allowed me to use a variable as the url; nice if I want to change the location later.\[code\].my_class{ background-image:url({{static_url}}myimage.jpg?version={% get_date_modifed 'my_image.jpg' %});}\[/code\]I also reference PIE.htc. It would be nice not to have to worry about updating the css manually, should the pie people decide to make a new version.\[code\]behavior: url({{static_url}}css/PIE.htc\[/code\]Any neat tricks for handling this? I'm wondering why I didn't just leave everything in the header. I'd hate to split my css, some in the separate file, some in the header.
 
Back
Top