Asset managers for Django - choose which one? [closed]
Asked Answered
B

5

24

I would like to bundle up css and javascript files. I also want to send far-future expire headers to clients, so I need file versioning.

A quick search across the Internet has shown there are several asset managers developed for Django. Here is a list of those that I could reach:

  1. django-compress
  2. django-assets
  3. django-assetpackager
  4. django-media-bundler
  5. django-mediacat
  6. django-site-assets
  7. django-static-management
  8. django-compressor

They seem to perform more or less the same job. django-compress, django-compressor and django-site-assets seem to be especially promising at the first glance. I will appreciate if someone provides feedback on any of them that will help me choose between them.

Bunton answered 5/11, 2009 at 22:22 Comment(2)
If you're looking to be exhaustive, you might also want to include django-compressor. github.com/mintchaos/django_compressorGermin
In 2011 the top 3 has changed significantly I think, djangoplugables.com has a nice feature chartMuzzle
B
2

Among the contenders I have chosen django-compressor because it is incredibly simple to use. Just put one or two tags (typical scenario: one for css and another for js) in the template and for most cases you are done without modifying anything; you don't even have to declare or modify settings, its default settings are good.

Bunton answered 9/11, 2009 at 13:53 Comment(0)
A
11

As you have already noticed, they all do the same thing (more or less). I decided to go ahead with django_compressor.

Also, I prefer to set expire headers or apply on-the-fly compression at the web server level. IMHO these operations should not be performed by the application itself, because sometimes it can lead to some issues, for instance setting Cache-Control or expiration headers on error pages etc. The mod_expires module is very easy to configure according to your needs. For on-the-fly compression using the DEFLATE output filter, I have used this mod_deflate configuration as is.

Aboveground answered 6/11, 2009 at 0:55 Comment(2)
Thanks for the feedback. I followed your choice and I can say django-compressor is incredibly easy to use. Regarding the other issue you mentioned, I have already been setting expire headers and gzipping images at the web server level (lighttpd is the choice), I'll just add css and js to the file types.Bunton
Gzipping images is a bad bad idea. At best, it's just increasing server load, at worse, it might actually increase the images file size.Execrable
A
7

New projects have been created since this question was asked.

You might want to take a look at django-pipeline, it's pretty nifty.

Artamas answered 28/2, 2012 at 14:19 Comment(2)
Thank you for updating this SO thread. django_compressor/"Compressor" w/ django 1.4 has been a nightmare.Neutralize
Is very nice and has also python3 supportDugas
Q
4

I've been using django-compress and I'm happy with it, especially because I can specify the back-end compressor (YUI works best with my JS for example).

I will probably consider switching to django_compressor in the future, but it's too low priority atm.

I would also point out that django-media-bundler has one feature the others don't... automatic building of image sprites. I haven't used it live, so I'm not sure how well it is implemented but that's pretty neat. You can use it just for the sprites and leave css/js for one of the other compressors.

Quinidine answered 6/11, 2009 at 11:12 Comment(1)
Thanks for the answer. My to-do list includes using css sprites, and I may give django-media-bundler a shot when the time comes. But for the time being I have fallen for the simplicity of django-compressor ;)Bunton
B
2

Among the contenders I have chosen django-compressor because it is incredibly simple to use. Just put one or two tags (typical scenario: one for css and another for js) in the template and for most cases you are done without modifying anything; you don't even have to declare or modify settings, its default settings are good.

Bunton answered 9/11, 2009 at 13:53 Comment(0)
A
2

FWIW since djangopluggables.com doesn't exist anymore and nobody has mentioned it here yet: The most recent comparison is on djangopackages.com, where django_compressor is the most used one ATM. Haven't tried it with 1.4 though as Jay Taylor warned in his comment.

Alliber answered 23/11, 2012 at 10:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.