3 comments

[ 3.3 ms ] story [ 16.7 ms ] thread
I much prefer django-compressor (https://github.com/mintchaos/django_compressor) and similar apps which allow the template designer - instead of a developer - to define the asset files.

Just wrap your stylesheet definitions in {% compress css %}{% endcompress %} (same for JS) and they get merged, minified, and updated automatically. No need to go into the settings.py to add a stylesheet.

Do you really want to say that designers are incapable of adding a little string to a settings file? You could easily move the media-related settings into a separate file, so there's really no confusion, at all.

There are several reasons why assets should be configured in the settings. The most important ones: (1) This is the only way to support sandboxes like App Engine. (2) This makes advanced features like HTML5 manifest support possible, at all (you have to know all generated assets in advance). (3) Assets are pre-generated, so when deploying a new version your users don't have to wait for yuicompressor and other stuff (e.g. upload to S3) to finish.

The only advantage of the template-based approach is that it's more "familiar". However, that approach has too many limitations and disadvantages. That's why we went with settings-based asset definitions.