views:

49

answers:

1

when using django, compressor, and clevercss, i set my css url to an absolute path. clevercss is then passed the path of the .ccss file without the COMPRESS_ROOT prefixed (the absolute path). when i set my css url to a relative path, clevercss processes the ccss files, but the browser then correctly looks for relatively placed css files (e.g. mywebsite.com/profile/user/1/css/stylesheet.css)

compressor, however, does use the MEDIA_ROOT when the css link is a relative url, but not when an absolute url is used. this has the unfortunate effect of my css either being rendered by clevercss and not accessible by the browser (unless on the home page), or clevercss not having access to the files (due to an absolute url being used). ironically, the examples offered on http://github.com/mintchaos/django_compressor use absolute urls for the css paths.

i think i'm doing something wrong here, but i'm not sure where it could be and have spent quite a few hours looking. i'm also currently running this locally through ./manage.py runserver and serving some static files (images) through django. (this is fine for my local development).

A: 

I can't speak to django-compressor specifically; but I have been dealing with finding a good automatic compression solution for the CSS and JS files of my Django-powered web applications. I'm currently using django-static. It's been really easy to set up and use, IMO. I was running into some issues running django-compress (different from django-compressor) when I decided to give django-static a try. So far it's been great. Might be worth checking out. It can be found here: http://github.com/peterbe/django-static.

Nate
I'll try it out.
Devin