4 ms·
I recently completed my struggle with AngularJS/Django and the asset pipeline. I was using django-compressor but that was really not pleasant. What I did was co
by davecap1 13y ago
I recently completed my struggle with AngularJS/Django and the asset pipeline. I was using django-compressor but that was really not pleasant. What I did was completely decouple my AngularJS app from my Django app. I stopped using Django's collectstatic as well, and now use Grunt to compile my assets into a temporary "static" directory (not stored in version control), from an "assets" directory (stored in version control). I then use a fabric task to upload the contents of "static" to S3, to new directory with an incremented build number (something like s3://my-bucket/dist/v1234/). Once that is done, I update STATIC_URL in my Django app to reflect the new dist path.
My one tip: forget about using Django to manage your assets if you need cache-busting... use fabric and something like grunt.