CodeForPhilly / stately

Form-driven workflow engine
http://tinyurl.com/statelydeck
21 stars 5 forks source link

Can django compile the client assets then serve them? #13

Open timwis opened 8 years ago

timwis commented 8 years ago

Looks like settings.py has a setting for a static directory. I wonder if it can execute a command like npm run build at startup to compile it?

mjumbewu commented 8 years ago

This isn't something that core Django does, but there are a number of packages that do it. It has been a couple years since I've explored the options. I used to use django-compressor, and looking over the field quickly, that might still be what I'd choose today (it does more than compressing, but precompiling too).

mjumbewu commented 8 years ago

Also, there's some decent analysis of and commentary on the current state of the art at http://owaislone.org/blog/modern-frontends-with-django/, and an alternative possibility at http://owaislone.org/blog/webpack-plus-reactjs-and-django/