#15213: [PATCH] Add support for compressors/minimizers to
django.contrib.staticfiles
----------------------------------------+-----------------------------------
Reporter: sebastian_noack | Owner:
Status: new | Milestone: 1.3
Component: django.contrib.staticfiles | Version: 1.3-alpha
Keywords: | Triage Stage: Unreviewed
Has patch: 1 |
----------------------------------------+-----------------------------------
It's common practice to use programs like jsmin and yui-compresser in
order to compress JS and CSS files to reduce traffic and accelerate the
parsing. Usually you wold compress those files when deploying the web
project. When you are using django.contrib.staticfiles that would be just
before or after you have called the collectstatic management command. So I
thought it would be great if that mangement command could do that for you
and have written the patch attached to this ticket. It adds a new setting
STATICFILES_COMPRESSORS. It's a dictionary mapping filename extensions to
command lines used to compress files with that extension. You can use any
external program that takes the raw file on stdin and outputs compressed
file to stdout. So for example if you would like to use yui-compressor,
you only have to add following to your settings module.
{{{
#!python
STATICFILES_COMPRESSORS = {
'js': 'yui-compressor --type js',
'css': 'yui-compressor --type css',
}
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/15213>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.