News for hackers. Stuff that matters.
Re:Things I Wish I Had Known About Django Development Before... by tracker1 on Thursday April 18, 2013 @01:27AM (#5569041)
Just responding to #16, it may be best to manage your static/client assets using NodeJS with grunt... It's not in the django chain, but may be worth calling the external. Node seems to be at the leading edge of JS & CSS tooling.

It's worth noting that I'm a pretty big NodeJS fan and am even using grunt via node for building the client bits in my latest .Net project at work. It's pretty sweet, though some addons are broken since the new grunt version.

Re:Things I Wish I Had Known About Django Development Before... by crucialfelix on Thursday April 18, 2013 @04:12AM (#5569435)
I've switched to this method as well and recently removed django-compressor. Better to have a tool that is used and improved by many, not just django people.

In the top level of my project I have a makefile so make assets runs grunt and collects static.

My grunt also runs jslint so it will halt if there are errors.

Re:Things I Wish I Had Known About Django Development Before... by andrewthornton on Thursday April 18, 2013 @06:42AM (#5569803)
Would you mind giving a little more of an overview of how you set this up? I think this would be incredibly useful.
Re:Things I Wish I Had Known About Django Development Before... by crucialfelix on Friday April 19, 2013 @02:49PM (#5578099)
I'm going to try to throw together a blog post.

basically though, I've used requirejs for the js both for single page apps and for general js like plugins and galleries.

compass/sass for the css which does minification and concatenation already, and also ensures there is no illegal css

js is processed by requirejs into STATIC_DIR/r/

css is compiled into myproject/static/myproject/css and then uses django's staticfiles system to collect and deploy

grunt is what calls requirejs. it could also concat and minimize css but compass has already done it. it also has watch and does live reload so that my browser will reload the css and even the js when either of them are edited.

on my pages I use a tag:

{% vcss "nestseekers/css/front.css" %}

which renders a <link css tag with a ?v=HASH appended

and

{% r_url 'nestseekers/js/libs/dist/html5shiv.js' %}

for the js