# Django Compress Feature

**URL:** <https://forum.ansible.com/t/django-compress-feature/13572>\
**Category:** Ansible Project\
**Created:** [September 28, 2013, 12:58pm UTC](https://forum.ansible.com/t/django-compress-feature/13572 "2013-09-28T12:58:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake\_Kreider](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@Jake\_Kreider](https://forum.ansible.com/u/Jake_Kreider)\
**Post date:** [September 28, 2013, 12:58pm UTC](https://forum.ansible.com/t/django-compress-feature/13572/1 "2013-09-28T12:58:51Z")

</div>

It would be nice if the django module could use the compress command for managing offline minification/concatenation of static files. This is part of the [django\_compressor](http://django-compressor.readthedocs.org/en/latest/) package, which is separate from Django, but is fairly popular and compressing offline would generally be part of a deploy step for those of us that use it. If this is something you think belongs in the Django module, let me know and I can work on a pull request for it (if that’s cool).

Thanks!

---

<div class="post-metadata">

**Author:** ![Skylar\_Saveland](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Skylar\_Saveland](https://forum.ansible.com/u/Skylar_Saveland)\
**Post date:** [September 28, 2013, 11:14pm UTC](https://forum.ansible.com/t/django-compress-feature/13572/2 "2013-09-28T23:14:20Z")

</div>

Note: I’ve just been playing with ansible for a couple of weeks. And thus, can’t really answer your questions.

I just took a quick look at the source in library/web\_infrastructure/django\_manage.

My first thought is that I would rather be able to do arbitrary management commands than be confined to what is setup in `command_allowed_param_map`.

It looks like the docs have come apart from the code a bit:

choices description code  
migrate Y Y  
runfcgi Y  
createcachetable Y Y  
…

Keeping this module working and useful for everyone using Django seems difficult. What version of django? What installed\_apps? Are we talking about south’s syncdb or django’s syncdb? What if I override migrate for myself? What if I have my own compress command? What about my own management commands that I need to run?

I wonder if it is too late to thin out this wrapper and let people run arbitrary management commands with little/no param checking? I suppose the advantages over the shell module could be in the integration with virtualenv, etc.

---

<div class="post-metadata">

**Author:** ![Javier\_Candeira](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Javier\_Candeira](https://forum.ansible.com/u/Javier_Candeira)\
**Post date:** [September 28, 2013, 11:25pm UTC](https://forum.ansible.com/t/django-compress-feature/13572/3 "2013-09-28T23:25:54Z")

</div>

Don't forget support for "changed".

At work we need to delete ghost migrations sometimes, so we had to put  
in a command "python manage.py migrate --delete-ghost-migrations  
--noinput". I was in a hurry, so I didn't try to put it in the  
django\_manage module (also, t didn't seem obvious how to provide for  
arbitrary options with .changed support in my available time).

I wasn't going to say anything on the list, but if we are going to  
generalise the django\_manage module, here's another use case.

J

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [September 28, 2013, 11:40pm UTC](https://forum.ansible.com/t/django-compress-feature/13572/4 "2013-09-28T23:40:48Z")

</div>

I’d like to see things continue to validate that the command is valid.

I’m ok with adding the new command as long as if it’s not installed there is sensible error detection.
