Maybe try to set the javascript STATIC_URL variable somewhere in base.html and user that everywhere, but I'm not sure how that would work with django-compressor and different loading orders.