Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
timwis opened this issue Sep 29, 2016 · 2 comments
Open

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

timwis opened this issue Sep 29, 2016 · 2 comments
Labels

Comments

@timwis
Copy link
Member

timwis commented Sep 29, 2016

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
Copy link
Member

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
Copy link
Member

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants