jezdez/django_compressor — Issue #223: compress management command fails with django-native-tags
Author: claymation
Created: 2012-03-04 09:03:52+00:00
State: open

We ran into some difficulty using django-compressor's `compress` management command with our project, and while the root cause turns out to be an interaction with the django-native-tags library, I've developed a work-around that I hope you'll accept as a patch.

django-native-tags (https://github.com/justquick/django-native-tags) allows apps to register template tags as built-ins, presumably to avoid a `{% load %}` directive. I don't understand why anybody would do that, but that's beside the point. This ability to register built-in tags poses a problem when using `manage.py compress`: templates that reference these tags raise TemplateSyntaxError. Since the `compress` management command does not validate models (#127), django does not initialize all installed apps before running the compressor, and `django-native-tags` never has a chance to register its built-in template tags.

This patch lets django initialize all apps (but presumably not connect to the database, which was the issue reported in #127) and register all built-in template tags before running the compressor.