0

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?

the_drow
  • 18,571
  • 25
  • 126
  • 193

1 Answers1

2

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).

Chris Pratt
  • 232,153
  • 36
  • 385
  • 444