the_drow
the_drow

Reputation: 19171

Modifying the behavior and testing the collectstatic management

I have an app that I'm writing that needs to include uncompressed javascript files when the DEBUG setting is true and compressed javascript files when the DEBUG setting is set to false.
In order to do that I'd like to modify the behavior of collectstatic to only collect filename.*debug/release*.js and rename them to filename.js from my app.
How can it be done?

Upvotes: 0

Views: 134

Answers (1)

Chris Pratt
Chris Pratt

Reputation: 239200

Just use something like django-compressor. It'll automatically compress and minify your CSS and Javascript for you in production (DEBUG=False), and serves them up as is in dev (DEBUG=True).

Upvotes: 2

Related Questions