Django implementation of AssetPackager, anyone?

7 views
Skip to first unread message

Alex Dong

unread,
Dec 10, 2007, 10:55:59 AM12/10/07
to Django users
Hello everyone,

I'm wondering are there anyone who is working on a django version of
the AssetPackager? I found it's a pretty cool performance booster with
little work required from the developer side. Definitely a tool for
perfectionist. :-)

Here is the url of the ruby version: http://synthesis.sbecker.net/pages/asset_packager

Ideally, here is all we need to put into the django template file.
<% javascript_include_merged "/static/js" %>
<% stylesheet_include_merged "/static/css" %>

Ideally, during development cycle, this custom tag will render out the
list of javascript/stylesheet files without doing any merge. But in
the production environemnt, DEBUG=False, it should generate the merged/
compressed files on the fly with the correct svn number associate with
it.

Alex

David Reynolds

unread,
Dec 10, 2007, 11:36:34 AM12/10/07
to django...@googlegroups.com

If there's a python library for compressing javascript files (which I
suspect there is) it shouldn't be too difficult to make your own
templatetag to do this.

Thanks,

Dave

--
David Reynolds
da...@reynoldsfamily.org.uk


David Reynolds

unread,
Dec 10, 2007, 11:47:39 AM12/10/07
to django...@googlegroups.com

On 10 Dec 2007, at 4:36 pm, David Reynolds wrote:

> If there's a python library for compressing javascript files (which I
> suspect there is) it shouldn't be too difficult to make your own
> templatetag to do this.

For example this...

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496882

Cheers,

David

--
David Reynolds
da...@reynoldsfamily.org.uk


Alex Dong

unread,
Dec 10, 2007, 8:38:07 PM12/10/07
to Django users
What's tricky here is how to do all of these on the fly and update the
output if there is any changes to the underlying javascript files. Any
thoughts on how to do that?

Or, maybe we should use a svn hook instead of django template tag for
this task?

Alex

On Dec 11, 12:47 am, David Reynolds <da...@reynoldsfamily.org.uk>
wrote:
Reply all
Reply to author
Forward
0 new messages