For django, I've been using django-compress:
<a href="http://code.google.com/p/django-compress/" rel="nofollow">http://code.google.com/p/django-compress/</a><p>Works with javascript as well as CSS, nicely incorporates cache control, ahead-of-time or on-the-fly generation, etc.  Works out of the box* in pure python, or it's trivial to plug eg YUI minifier or google-closure.<p>* Actually, last I looked there was a bug in the CSS minifier it ships with (<a href="http://code.google.com/p/django-compress/issues/detail?id=27" rel="nofollow">http://code.google.com/p/django-compress/issues/detail?id=27</a>), but I believe the upstream version has been fixed.