Sigh... figured out the error...
So! I have my settings.py file which contains:
[settings.py]
import os
BEETLEJUICE_STATE = os.environ.get('BTJC_STATE', None)
if BEETLEJUICE_STATE == 'LOCAL':
from local_settings import *
elif BEETLEJUICE_STATE == 'DEV':
from development_settings import *
elif BEETLEJUICE_STATE == 'PROD':
from production_settings import *
else:
raise ImportError
<aside>
... which used to be the right way to do things (or so I was told). I'm planning to switch over to the way that Audrey and Danny recommend in Two Scoops of Django, the gist of which being:
settings/
__init__.py
base.py
local.py
test.py
production.py
... and explicitly call my settings files from now on, e.g.
python manage.py runserver --settings='settings.production'
...which imports from base.py
and has all the production-specific settings.
</aside>
... and I had BTJC_STATE being exported in the virtualenvwrapper postactivate
file, except that by running celeryd via supervisor I wasn't activating anything and thereby skipping that file entirely! This raised the ImportError but I didn't realise that was where it was coming from =(
Adding a string explaining the exception is a good idea... and apparently using ImproperlyConfigured is a better way to raise for this issue. So by changing the one line below in my .conf file, it started working perfectly.
[program:celery_beetlejuice]
<snip>
environment=BTJC_STATE='LOCAL'
<snip>
So that works now and I'm happy, but I need to find a good way of setting environment variables (like database passwords, api keys, and such) that will work well with for inside a non-activated in-use virtualenv.
All advice welcome on that, message me and I'll update this with the solution =)