rfk/django-supervisor — Issue #16: Idea: add ability to override config file location
Author: j4mie
Created: 2012-03-09 15:00:22+00:00
State: open

Hi,

I have a suggestion for a nice feature that would make using django-supervisor in multiple environments much easier.

Currently, the main config file is hardcoded to be `supervisord.conf`. The templated config approach makes it really easy to add things like `{% if settings.DEBUG %}` to change the behaviour based on the environment. However, there's only so far you can take this. For example, I might want to specify different logging directories on staging and production servers, and I'm finding myself writing things like `{% if "production" in settings.SETTINGS_MODULE %}`, which feels very ugly.

What do you think about the idea of adding a `-c/--config` flag to `manage.py supervisor` to allow me to maintain a completely different config file for each environment? `{{ PROJECT_DIR }}/supervisord.conf` would still be the default, and app-specific configs would still live in `/management/supervisord.conf`.

It might even be possible to use template inheritance on your configs.. but maybe that's taking things a bit far ;)

What do you think? I'm happy to have a go at implementing it, if you think it's a good idea.

Cheers