Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Would you mind giving a little more of an overview of how you set this up? I think this would be incredibly useful.


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




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: