News for hackers. Stuff that matters.
Re:Must-have Django packages by TheMakeA on Thursday January 09, 2014 @12:44PM (#7031901)
What are people using these days for compiling their static assets (js minification + concatenation, etc)? We have been using django-pipeline but it has been a nightmare.
Re:Must-have Django packages by conesus on Thursday January 09, 2014 @01:46PM (#7032296)
I use Jammit for static asset compression.

(from https://medium.com/cs-math/f29f6080c131) Jammit came out of DocumentCloud, and even though it was built for Ruby on Rails you can do something like this and use it for Django pretty easily. One of the things I like about it is you can setup different named configurations for javascript and css for different sections of your site (dashboard, non-authenticated, standard). It supports lots of other stuff too.

This is how I use Jammit on NewsBlur: https://github.com/samuelclay/NewsBlur/blob/master/utils/jam.... I then compress the assets, upload to S3, and then deploy to my servers. See https://github.com/samuelclay/NewsBlur/blob/master/fabfile.p.... Each app server then downloads from S3. So I can package 2MB of static assets and deploy to to a hundred servers in 10 seconds.

Re:Must-have Django packages by peter_l_downs on Thursday January 09, 2014 @02:01PM (#7032420)
We're currently using Django Compressor [0], and it works pretty well. It was slightly annoying to get it to work well with staticfiles [1], as we host all of our content on S3 and serve through cloudfront in production. But, it's nice because now we can do this in our template:

    <script src="{% static js/mylib.js %}"></script>
and with compress like this:

    {% compress js %}
      <script src="{% static js/mylib.js %}"></script>
    {% endcompress %}
so that referencing static files is consistent.

[0]: https://github.com/jezdez/django_compressor

[1]: https://docs.djangoproject.com/en/dev/ref/contrib/staticfile...

Re:Must-have Django packages by michaelmior on Friday January 10, 2014 @08:13AM (#7036392)
I used to use this, and it is convenient for small sites. But it quickly gets hard to manage. It also makes it extremely difficult to share compiled assets between pages with different templates.
Re:Must-have Django packages by Spiritus on Thursday January 09, 2014 @04:19PM (#7033339)
Why has it been a nightmare? I find it pretty neat. Was using django-compressor earlier but it didn't have support for Python 3.
Re:Must-have Django packages by fletchowns on Thursday January 09, 2014 @07:42PM (#7034290)
I'm curious what problems he had with django-pipeline as well. I've been using it for a couple months now and it has been fantastic.
Re:Must-have Django packages by falcolas on Thursday January 09, 2014 @04:33PM (#7033415)
Caveat: Small site, low enough traffic that a few kilobytes per request won't break us.

I just enable gzipping and don't worry about minification of my own assets. Sure, it means larger initial downloads (since they're cached), but it's typically in the single digit kilobytes, and simplifies debugging like nothing else.

Re:Must-have Django packages by papercruncher on Thursday January 09, 2014 @12:58PM (#7031991)
We switched to the google pagespeed module for nginx and stop worrying about it. It doesn't do minification very well but it does concatenation and takes care of a bunch of other stuff as well, like image resizing, CSS concatenation etc.

We used to use the HTML5 Boilerplate script but it was horrendously slow on EC2

Re:Must-have Django packages by mikewhy on Thursday January 09, 2014 @01:59PM (#7032399)
http://brunch.io/ I've use it in Django, Flask, Rails and static sites with Chaplin, Backbone and now Angular. Works a charm.
Re:Must-have Django packages by ludwigvan on Thursday January 09, 2014 @04:00PM (#7033195)
Re:Must-have Django packages by michaelmior on Friday January 10, 2014 @08:14AM (#7036394)
+1 for django-assets. I've found this to be the best solution so far. I've used it combination with django-storages to compile and push assets to S3.
Re:Must-have Django packages by tdj on Thursday January 09, 2014 @01:06PM (#7032042)
I'm pretty happy with django-compressor.
Re:Must-have Django packages by bigsassy on Thursday January 09, 2014 @01:29PM (#7032197)
Me too.
Re:Must-have Django packages by rule30 on Thursday January 09, 2014 @12:48PM (#7031934)
This is a brilliant question, any package about that?
Re:Must-have Django packages by mixmastamyk on Thursday January 09, 2014 @01:48PM (#7032319)
make (actually a simpler alternative).
Re:Must-have Django packages by msonawane on Thursday January 09, 2014 @10:10PM (#7034877)
nginx + pagespeed should be better way of doing it